diff --git a/ui-ngx/src/app/core/auth/auth.models.ts b/ui-ngx/src/app/core/auth/auth.models.ts
index 21759fbca0..9218b09df1 100644
--- a/ui-ngx/src/app/core/auth/auth.models.ts
+++ b/ui-ngx/src/app/core/auth/auth.models.ts
@@ -37,6 +37,7 @@ export interface SysParamsState {
maxRelationLevelPerCfArgument: number;
ruleChainDebugPerTenantLimitsConfiguration?: string;
calculatedFieldDebugPerTenantLimitsConfiguration?: string;
+ intermediateAggregationIntervalInSecForCF: number;
trendzSettings: TrendzSettings;
}
diff --git a/ui-ngx/src/app/core/auth/auth.reducer.ts b/ui-ngx/src/app/core/auth/auth.reducer.ts
index af040a6d53..aad609356a 100644
--- a/ui-ngx/src/app/core/auth/auth.reducer.ts
+++ b/ui-ngx/src/app/core/auth/auth.reducer.ts
@@ -39,6 +39,7 @@ const emptyUserAuthState: AuthPayload = {
maxRelationLevelPerCfArgument: 0,
maxDataPointsPerRollingArg: 0,
maxDebugModeDurationMinutes: 0,
+ intermediateAggregationIntervalInSecForCF: 0,
userSettings: initialUserSettings,
trendzSettings: initialTrendzSettings
};
diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/components/entity-aggregation-configuration/entity-aggregation-component.component.html b/ui-ngx/src/app/modules/home/components/calculated-fields/components/entity-aggregation-configuration/entity-aggregation-component.component.html
index 4dcbf5b38d..c49c6f25cc 100644
--- a/ui-ngx/src/app/modules/home/components/calculated-fields/components/entity-aggregation-configuration/entity-aggregation-component.component.html
+++ b/ui-ngx/src/app/modules/home/components/calculated-fields/components/entity-aggregation-configuration/entity-aggregation-component.component.html
@@ -124,6 +124,15 @@
}
+
Observable;
readonly minAllowedAggregationIntervalInSecForCF = getCurrentAuthState(this.store).minAllowedAggregationIntervalInSecForCF;
+ readonly intermediateAggregationIntervalInSecForCF = getCurrentAuthState(this.store).intermediateAggregationIntervalInSecForCF;
readonly DayInSec = DAY / SECOND;
entityAggregationConfiguration = this.fb.group({
@@ -104,6 +105,7 @@ export class EntityAggregationComponentComponent implements ControlValueAccessor
watermark: this.fb.group({
duration: [HOUR/SECOND, Validators.required],
}),
+ produceIntermediateResult: [false],
output: this.fb.control(defaultCalculatedFieldOutput),
});
@@ -153,6 +155,15 @@ export class EntityAggregationComponentComponent implements ControlValueAccessor
this.updatedOffsetHint();
});
+ merge(
+ this.entityAggregationConfiguration.get('interval.type').valueChanges,
+ this.entityAggregationConfiguration.get('interval.durationSec').valueChanges
+ ).pipe(
+ takeUntilDestroyed()
+ ).subscribe(() => {
+ this.checkProduceIntermediate();
+ });
+
this.entityAggregationConfiguration.valueChanges.pipe(
takeUntilDestroyed()
).subscribe((value: CalculatedFieldEntityAggregationConfigurationValue) => {
@@ -174,6 +185,7 @@ export class EntityAggregationComponentComponent implements ControlValueAccessor
this.checkAggIntervalType(this.entityAggregationConfiguration.get('interval.type').value);
this.checkIntervalDuration(this.entityAggregationConfiguration.get('interval.allowOffsetSec').value);
this.checkWatermark(this.entityAggregationConfiguration.get('allowWatermark').value);
+ this.checkProduceIntermediate();
this.updatedOffsetHint();
setTimeout(() => {
this.entityAggregationConfiguration.get('arguments').updateValueAndValidity({onlySelf: true});
@@ -194,6 +206,7 @@ export class EntityAggregationComponentComponent implements ControlValueAccessor
this.checkAggIntervalType(this.entityAggregationConfiguration.get('interval.type').value);
this.checkIntervalDuration(this.entityAggregationConfiguration.get('interval.allowOffsetSec').value);
this.checkWatermark(this.entityAggregationConfiguration.get('allowWatermark').value);
+ this.checkProduceIntermediate();
}
}
@@ -255,16 +268,49 @@ export class EntityAggregationComponentComponent implements ControlValueAccessor
}
}
+ private checkProduceIntermediate() {
+ const intervalType = this.entityAggregationConfiguration.get('interval.type').value as AggIntervalType;
+ let durationSec = 0;
+ switch (intervalType) {
+ case AggIntervalType.CUSTOM:
+ durationSec = this.entityAggregationConfiguration.get('interval.durationSec').value;
+ break
+ case AggIntervalType.HOUR:
+ durationSec = HOUR / SECOND;
+ break
+ case AggIntervalType.DAY:
+ durationSec = DAY / SECOND;
+ break
+ case AggIntervalType.WEEK:
+ case AggIntervalType.WEEK_SUN_SAT:
+ durationSec = WEEK / SECOND;
+ break
+ case AggIntervalType.MONTH:
+ durationSec = AVG_MONTH / SECOND;
+ break
+ case AggIntervalType.QUARTER:
+ durationSec = AVG_QUARTER / SECOND;
+ break
+ case AggIntervalType.YEAR:
+ durationSec = YEAR / SECOND;
+ break
+ }
+ if (durationSec > this.intermediateAggregationIntervalInSecForCF) {
+ this.entityAggregationConfiguration.get('produceIntermediateResult').enable({emitEvent: false});
+ } else {
+ this.entityAggregationConfiguration.get('produceIntermediateResult').disable({emitEvent: false});
+ }
+ }
+
private updatedOffsetHint(): void {
const offset = this.entityAggregationConfiguration.get('interval.offsetSec').value;
const intervalType = this.entityAggregationConfiguration.get('interval.type').value as AggIntervalType;
const durationSec = this.entityAggregationConfiguration.get('interval.durationSec').value;
const offsetCategory = this.getTimeCategory(offset);
const now = _moment.utc();
- let interval: string = '';
+ let interval: string;
if (intervalType === AggIntervalType.CUSTOM) {
- const durationSecCategory = this.getTimeCategory(durationSec);
- const formatString = this.getCustomFormatString(offsetCategory, durationSecCategory);
+ const formatString = this.getCustomFormatString(offsetCategory, this.getTimeCategory(durationSec));
const intervals: string[] = [];
let allInterval = durationSec >= HOUR*6/SECOND && durationSec < DAY/SECOND;
now.startOf('year').add(offset, 'seconds');
diff --git a/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html
index 4c311333ec..8a93423e4d 100644
--- a/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html
+++ b/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html
@@ -368,6 +368,34 @@
+
+
+ tenant-profile.intermediate-aggregation-interval
+
+
+ {{ 'tenant-profile.intermediate-aggregation-interval-required' | translate}}
+
+
+ {{ 'tenant-profile.intermediate-aggregation-interval-range' | translate}}
+
+
+
+
+ tenant-profile.reevaluation-check-interval
+
+
+ {{ 'tenant-profile.reevaluation-check-interval-required' | translate}}
+
+
+ {{ 'tenant-profile.reevaluation-check-interval-range' | translate}}
+
+
+
+
tenant-profile.relation-search-entity-limit
@@ -526,6 +554,22 @@
+
+
+ tenant-profile.alarms-reevaluation-interval
+
+
+ {{ 'tenant-profile.alarms-reevaluation-interval-required' | translate}}
+
+
+ {{ 'tenant-profile.alarms-reevaluation-interval-range' | translate}}
+
+
+
+
+