Commit 7fcf2615 by Torkel Ödegaard Committed by GitHub

Metrictank: Fixed updated schema and dedupe strategy (#24685)

* Metrictank: Fixed updated schema and dedupe strategy

* revert schema change

* fix
parent b73d237b
......@@ -20,7 +20,7 @@ export class MetricTankMetaInspector extends PureComponent<Props, State> {
const buckets = parseSchemaRetentions(meta['schema-retentions']);
const rollupNotice = getRollupNotice([meta]);
const runtimeNotice = getRuntimeConsolidationNotice([meta]);
const normFunc = (meta['consolidator-normfetch'] || '').replace('Consolidator', '');
const normFunc = (meta['consolidator-normfetch'] ?? '').replace('Consolidator', '');
let totalSeconds = 0;
......@@ -99,7 +99,7 @@ export class MetricTankMetaInspector extends PureComponent<Props, State> {
if (series.meta && series.meta.custom) {
for (const metaItem of series.meta.custom.seriesMetaList as MetricTankSeriesMeta[]) {
// key is to dedupe as many series will have identitical meta
const key = `${metaItem['schema-name']}-${metaItem['archive-read']}`;
const key = `${JSON.stringify(metaItem)}`;
if (seriesMetas[key]) {
seriesMetas[key].count += metaItem.count;
......
......@@ -38,7 +38,7 @@ export function getRollupNotice(metaList: MetricTankSeriesMeta[]): QueryResultMe
if (archiveIndex > 0) {
const schema = parseSchemaRetentions(meta['schema-retentions']);
const intervalString = schema[archiveIndex].interval;
const func = meta['consolidator-normfetch'].replace('Consolidator', '');
const func = (meta['consolidator-normfetch'] ?? '').replace('Consolidator', '');
return {
text: `Data is rolled up, aggregated over ${intervalString} using ${func} function`,
......@@ -56,7 +56,7 @@ export function getRuntimeConsolidationNotice(metaList: MetricTankSeriesMeta[]):
const runtimeNr = meta['aggnum-rc'];
if (runtimeNr > 0) {
const func = meta['consolidator-rc'].replace('Consolidator', '');
const func = (meta['consolidator-rc'] ?? '').replace('Consolidator', '');
return {
text: `Data is runtime consolidated, ${runtimeNr} datapoints combined using ${func} function`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment