Skip to content

Commit

Permalink
Fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Jun 23, 2020
1 parent 746c4b1 commit 6a2dead
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 10 additions & 1 deletion x-pack/plugins/infra/common/alerting/metrics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ const baseAlertRequestParamsRT = rt.intersection([
sourceId: rt.string,
}),
rt.type({
lookback: rt.union([rt.literal('h'), rt.literal('d'), rt.literal('w'), rt.literal('M')]),
lookback: rt.union([
rt.literal('ms'),
rt.literal('s'),
rt.literal('m'),
rt.literal('h'),
rt.literal('d'),
rt.literal('w'),
rt.literal('M'),
rt.literal('y'),
]),
criteria: rt.array(rt.any),
alertInterval: rt.string,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { Unit } from '@elastic/datemath';
import { SnapshotMetricType } from '../../../../common/inventory_models/types';

export const METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID = 'metrics.alert.inventory.threshold';
Expand All @@ -23,12 +24,10 @@ export enum AlertStates {
ERROR,
}

export type TimeUnit = 's' | 'm' | 'h' | 'd';

export interface InventoryMetricConditions {
metric: SnapshotMetricType;
timeSize: number;
timeUnit: TimeUnit;
timeUnit: Unit;
sourceId?: string;
threshold: number[];
comparator: Comparator;
Expand Down

0 comments on commit 6a2dead

Please sign in to comment.