Test Total - Aggregation Source
Summary
The Test Total data source is a SummationSource that aggregates values from multiple test data sources in the mock environment. This aggregation provides a single consolidated view of all test values.
Data Flow
Test Source 1 (42) ──┐
├─► Test Total (158)
Test Source 2 (17) ──┤
│
Test Source 3 (99) ──┘
Aggregation Details
Source Components
The following sources contribute to this total:
- test-1: Static value of
42
- test-2: Static value of
17
- test-3: Static value of
99
Calculation Method
- Type: Simple summation
- Formula:
test-1 + test-2 + test-3 = 42 + 17 + 99 = 158
- Update Frequency: Real-time (whenever child sources change)
Technical Implementation
Class Structure
class SummationSource extends DataSourceBase {
private childSources: DataSource[];
constructor(id: string, name: string, sources: DataSource[]) {
super(id, name, "Sum of X dataloaders sources");
this.childSources = sources;
}
}
Error Handling
- Missing Sources: Gracefully handles null/undefined child sources
- Calculation Errors: Returns 0 if any child source fails
- Validation: Ensures all child sources are valid before aggregation
Use Cases
✅ Ideal For
- Testing hierarchical data structures
- Validating aggregation logic
- Performance benchmarking with known values
- Integration testing of data flows
❌ Not Suitable For
- Production environments
- Real-world data analysis
- Variable or time-dependent calculations
Monitoring & Validation
Expected Behavior
- Total should always equal
158 in mock environment
- Changes instantly when child sources update
- Maintains consistency across application restarts
Troubleshooting
If the total doesn't equal 158:
- Check that all three child sources are loaded
- Verify no sources are disabled
- Ensure aggregation calculation is functioning
- Review audit logs for any errors
This is a synthetic aggregation for testing purposes only.