From 135f504901a4b73915d5fbdca365b03e099209b5 Mon Sep 17 00:00:00 2001 From: Prathamesh Mutkure Date: Wed, 20 Sep 2023 01:28:08 +0530 Subject: [PATCH] Added JSDoc comments for time unit constants Signed-off-by: Prathamesh Mutkure --- packages/jaeger-ui/src/utils/date.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/jaeger-ui/src/utils/date.tsx b/packages/jaeger-ui/src/utils/date.tsx index 91f21ee373..dd4308d16c 100644 --- a/packages/jaeger-ui/src/utils/date.tsx +++ b/packages/jaeger-ui/src/utils/date.tsx @@ -27,12 +27,25 @@ const YESTERDAY = 'Yesterday'; export const STANDARD_DATE_FORMAT = 'YYYY-MM-DD'; export const STANDARD_TIME_FORMAT = 'HH:mm'; export const STANDARD_DATETIME_FORMAT = 'MMMM D YYYY, HH:mm:ss.SSS'; + +/** @constant 1μs is the precision of Jaeger timestamps */ export const ONE_MICROSECOND = 1; + +/** @constant 1ms as the number of microseconds, which is the precision of Jaeger timestamps */ export const ONE_MILLISECOND = 1000 * ONE_MICROSECOND; + +/** @constant 1s as the number of microseconds, which is the precision of Jaeger timestamps */ export const ONE_SECOND = 1000 * ONE_MILLISECOND; + +/** @constant 1m as the number of microseconds, which is the precision of Jaeger timestamps */ export const ONE_MINUTE = 60 * ONE_SECOND; + +/** @constant 1h as the number of microseconds, which is the precision of Jaeger timestamps */ export const ONE_HOUR = 60 * ONE_MINUTE; + +/** @constant 1d as the number of microseconds, which is the precision of Jaeger timestamps */ export const ONE_DAY = 24 * ONE_HOUR; + export const DEFAULT_MS_PRECISION = Math.log10(ONE_MILLISECOND); const UNIT_STEPS: { unit: string; microseconds: number; ofPrevious: number }[] = [