@kumori/aurora-backend-handler 1.0.138 → 1.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ import { Environment, Service } from "@kumori/aurora-interfaces";
|
|
|
2
2
|
import { getReporting, ReportingTarget } from "../api/reporting-api-service";
|
|
3
3
|
|
|
4
4
|
const REPORTING_ITERATIONS = 5;
|
|
5
|
-
const REPORTING_MAX_AGE_MS =
|
|
5
|
+
const REPORTING_MAX_AGE_MS = 60 * 60 * 1000;
|
|
6
6
|
|
|
7
7
|
interface ReportingContext {
|
|
8
8
|
environmentsMap: Map<string, Environment>;
|
|
@@ -53,7 +53,9 @@ const applyReporting = (
|
|
|
53
53
|
expiryTimers.delete(key);
|
|
54
54
|
|
|
55
55
|
const values = dataPoints.map(toMilliCores).slice(-REPORTING_ITERATIONS);
|
|
56
|
-
const expiredValues = values.
|
|
56
|
+
const expiredValues = values.length
|
|
57
|
+
? [...values, 0].slice(-REPORTING_ITERATIONS)
|
|
58
|
+
: values;
|
|
57
59
|
const remainingMs =
|
|
58
60
|
getNewestSampleTime(dataPoints) + REPORTING_MAX_AGE_MS - Date.now();
|
|
59
61
|
|