From e868475c5b5f2ead9404f12e9e9aeebe9917805c Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Thu, 21 Mar 2019 15:48:22 +0900 Subject: [PATCH] simplify --- public/app/plugins/datasource/prometheus/datasource.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index 9f8a912e554..68e3cdb8149 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -366,11 +366,12 @@ export class PrometheusDatasource implements DataSourceApi { }; if (annotation.useValueForTime) { - if (dupCheck[value[1]]) { + const timestampValue = Math.floor(parseFloat(value[1])); + if (dupCheck[timestampValue]) { continue; } - dupCheck[value[1]] = true; - event['time'] = Math.floor(parseFloat(value[1])); + dupCheck[timestampValue] = true; + event['time'] = timestampValue; } else { event['time'] = Math.floor(parseFloat(value[0])) * 1000; }