Add autoscaling outcomes to Metrics (Refs #140)
This commit is contained in:
@@ -24,6 +24,14 @@ const matches = (value: unknown) =>
|
||||
) &&
|
||||
(value.averageGroupSize === null || nonnegative(value.averageGroupSize)) &&
|
||||
(value.soloShare === null || (nonnegative(value.soloShare) && value.soloShare <= 100));
|
||||
const autoscaling = (value: unknown) =>
|
||||
record(value) &&
|
||||
['added', 'removed', 'failed', 'cancelled', 'readinessSamples'].every(
|
||||
(key) => nonnegative(value[key]) && Number.isInteger(value[key])
|
||||
) &&
|
||||
['readinessMeanSeconds', 'readinessMaxSeconds'].every(
|
||||
(key) => value[key] === null || nonnegative(value[key])
|
||||
);
|
||||
const policy = (value: unknown) =>
|
||||
value === null ||
|
||||
(record(value) &&
|
||||
@@ -40,7 +48,8 @@ function validReport(value: unknown): value is MetricsData {
|
||||
!numeric(value.since) ||
|
||||
!totals(value.summary) ||
|
||||
!running(value.running) ||
|
||||
!matches(value.matches)
|
||||
!matches(value.matches) ||
|
||||
!autoscaling(value.autoscaling)
|
||||
)
|
||||
return false;
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user