Skip to content

Commit

Permalink
Added JSDoc comments for time unit constants
Browse files Browse the repository at this point in the history
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
  • Loading branch information
prathamesh-mutkure committed Sep 19, 2023
1 parent 0c79067 commit 1095a96
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/jaeger-ui/src/utils/date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }[] = [
Expand Down

0 comments on commit 1095a96

Please sign in to comment.