From 743c98532d1743f6e2709022f8c92454c82b9eb6 Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Mon, 19 Nov 2018 16:42:56 -0800 Subject: [PATCH] Metric: use number for timestamp instead of interface --- .../src/metrics/export/types.ts | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/packages/opencensus-core/src/metrics/export/types.ts b/packages/opencensus-core/src/metrics/export/types.ts index 877efa459..6597f7bbd 100644 --- a/packages/opencensus-core/src/metrics/export/types.ts +++ b/packages/opencensus-core/src/metrics/export/types.ts @@ -121,7 +121,7 @@ export interface TimeSeries { * interval (start_timestamp, timestamp]. If not specified, the backend can * use the previous recorded value. */ - readonly startTimestamp: Timestamp; + readonly startTimestamp: number|null; /** * The set of label values that uniquely identify this timeseries. Applies to * all points. The order of label values must match that of label keys in the @@ -147,7 +147,7 @@ export interface Point { * The moment when this point was recorded. Inclusive. * If not specified, the timestamp will be decided by the backend. */ - readonly timestamp: Timestamp; + readonly timestamp: number; /** * The actual point value. * 64-bit integer or 64-bit double-precision floating-point number @@ -253,7 +253,7 @@ export interface Exemplar { */ readonly value: number; /** The observation (sampling) time of the above value. */ - readonly timestamp: Timestamp; + readonly timestamp: number; /** Contextual information about the example value. */ readonly attachments: {[key: string]: string}; } @@ -309,19 +309,3 @@ export interface ValueAtPercentile { /** The value at the given percentile of a distribution. */ readonly value: number; } - -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number|null; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number|null; -}