-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metrics UI] Remove TSVB dependency from Metrics Explorer APIs (#74804)
* [Metrics UI] Remove TSVB dependency from Metrics Explorer APIs * Update x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_title.tsx Co-authored-by: Zacqary Adam Xeper <[email protected]> * Update x-pack/plugins/infra/server/lib/metrics/lib/calculate_bucket_size/calculate_auto.ts Co-authored-by: Zacqary Adam Xeper <[email protected]> * Update x-pack/plugins/infra/server/lib/metrics/lib/calculate_bucket_size/calculate_auto.ts Co-authored-by: Zacqary Adam Xeper <[email protected]> * Update x-pack/plugins/infra/server/lib/metrics/lib/convert_histogram_buckets_to_timeseries.ts Co-authored-by: Zacqary Adam Xeper <[email protected]> * Update x-pack/plugins/infra/server/lib/metrics/lib/convert_histogram_buckets_to_timeseries.ts Co-authored-by: Zacqary Adam Xeper <[email protected]> * Update x-pack/plugins/infra/server/routes/metrics_explorer/lib/find_interval_for_metrics.ts Co-authored-by: Zacqary Adam Xeper <[email protected]> * Fixing some names, changing some units * Reverting TSVB calculate_auto; fixing names in infra * Fixing translation names * Fixing typo Co-authored-by: Zacqary Adam Xeper <[email protected]> Co-authored-by: Zacqary Adam Xeper <[email protected]>
- Loading branch information
1 parent
24c2e0a
commit 1632391
Showing
80 changed files
with
2,190 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import * as rt from 'io-ts'; | ||
import { MetricsUIAggregationRT } from '../inventory_models/types'; | ||
import { afterKeyObjectRT } from './metrics_explorer'; | ||
|
||
export const MetricsAPITimerangeRT = rt.type({ | ||
field: rt.string, | ||
from: rt.number, | ||
to: rt.number, | ||
interval: rt.string, | ||
}); | ||
|
||
const groupByRT = rt.union([rt.string, rt.null, rt.undefined]); | ||
|
||
export const MetricsAPIMetricRT = rt.type({ | ||
id: rt.string, | ||
aggregations: MetricsUIAggregationRT, | ||
}); | ||
|
||
export const MetricsAPIRequestRT = rt.intersection([ | ||
rt.type({ | ||
timerange: MetricsAPITimerangeRT, | ||
indexPattern: rt.string, | ||
metrics: rt.array(MetricsAPIMetricRT), | ||
}), | ||
rt.partial({ | ||
groupBy: rt.array(groupByRT), | ||
afterKey: rt.union([rt.null, afterKeyObjectRT]), | ||
limit: rt.union([rt.number, rt.null, rt.undefined]), | ||
filters: rt.array(rt.object), | ||
forceInterval: rt.boolean, | ||
dropLastBucket: rt.boolean, | ||
alignDataToEnd: rt.boolean, | ||
}), | ||
]); | ||
|
||
export const MetricsAPIPageInfoRT = rt.type({ | ||
afterKey: rt.union([rt.null, afterKeyObjectRT, rt.undefined]), | ||
interval: rt.number, | ||
}); | ||
|
||
export const MetricsAPIColumnTypeRT = rt.keyof({ | ||
date: null, | ||
number: null, | ||
string: null, | ||
}); | ||
|
||
export const MetricsAPIColumnRT = rt.type({ | ||
name: rt.string, | ||
type: MetricsAPIColumnTypeRT, | ||
}); | ||
|
||
export const MetricsAPIRowRT = rt.intersection([ | ||
rt.type({ | ||
timestamp: rt.number, | ||
}), | ||
rt.record(rt.string, rt.union([rt.string, rt.number, rt.null, rt.undefined])), | ||
]); | ||
|
||
export const MetricsAPISeriesRT = rt.intersection([ | ||
rt.type({ | ||
id: rt.string, | ||
columns: rt.array(MetricsAPIColumnRT), | ||
rows: rt.array(MetricsAPIRowRT), | ||
}), | ||
rt.partial({ | ||
keys: rt.array(rt.string), | ||
}), | ||
]); | ||
|
||
export const MetricsAPIResponseRT = rt.type({ | ||
series: rt.array(MetricsAPISeriesRT), | ||
info: MetricsAPIPageInfoRT, | ||
}); | ||
|
||
export type MetricsAPITimerange = rt.TypeOf<typeof MetricsAPITimerangeRT>; | ||
|
||
export type MetricsAPIColumnType = rt.TypeOf<typeof MetricsAPIColumnTypeRT>; | ||
|
||
export type MetricsAPIMetric = rt.TypeOf<typeof MetricsAPIMetricRT>; | ||
|
||
export type MetricsAPIPageInfo = rt.TypeOf<typeof MetricsAPIPageInfoRT>; | ||
|
||
export type MetricsAPIColumn = rt.TypeOf<typeof MetricsAPIColumnRT>; | ||
|
||
export type MetricsAPIRow = rt.TypeOf<typeof MetricsAPIRowRT>; | ||
|
||
export type MetricsAPISeries = rt.TypeOf<typeof MetricsAPISeriesRT>; | ||
|
||
export type MetricsAPIRequest = rt.TypeOf<typeof MetricsAPIRequestRT>; | ||
|
||
export type MetricsAPIResponse = rt.TypeOf<typeof MetricsAPIResponseRT>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.