-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Duration Formatting for TSVB (#13337)
* Adding duration formatter * Adding decimal places * Fixing bug with decimals * Relaxing the duration format test
- Loading branch information
1 parent
ef67957
commit 7fb2d7f
Showing
3 changed files
with
126 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/core_plugins/metrics/public/components/lib/durations.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const durationOutputOptions = [ | ||
{ label: 'milliseconds', value: 'ms' }, | ||
{ label: 'seconds', value: 's' }, | ||
{ label: 'minutes', value: 'm' }, | ||
{ label: 'hours', value: 'h' }, | ||
{ label: 'days', value: 'd' }, | ||
{ label: 'weeks', value: 'w' }, | ||
{ label: 'months', value: 'M' }, | ||
{ label: 'years', value: 'Y' } | ||
]; | ||
|
||
export const durationInputOptions = [ | ||
{ label: 'picoseconds', value: 'ps' }, | ||
{ label: 'nanoseconds', value: 'ns' }, | ||
{ label: 'microseconds', value: 'us' }, | ||
...durationOutputOptions | ||
]; | ||
|
32 changes: 26 additions & 6 deletions
32
src/core_plugins/metrics/public/components/lib/tick_formatter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters