Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use time units in the Web UI which are easy to read by humans #319

Closed
cspurk opened this issue Jan 28, 2019 · 5 comments · Fixed by #647
Closed

Use time units in the Web UI which are easy to read by humans #319

cspurk opened this issue Jan 28, 2019 · 5 comments · Fixed by #647

Comments

@cspurk
Copy link

cspurk commented Jan 28, 2019

Requirement - what kind of business use case are you trying to solve?

Always use time units in the Web UI which are easy to read by humans.

We use Jaeger to trace some complex, long-running offline jobs in which a seconds granularity in the Web UI is too fine-grained for human consumption.

Problem - what in Jaeger blocks you from solving the requirement?

Currently, durations seem to be shown in either milliseconds (“ms”) or seconds (“s”). For traces of long-running requests/jobs a duration like “26904.23s” is not very readable.

Proposal - what do you suggest to solve the problem or improve the existing situation?

Instead of showing a duration like “26904.23s”, a duration like “7.47 h” or even “7 h 28 m 24.23 s” would be better for human consumption.

@yurishkuro
Copy link
Member

please indicate which views you are referring to

@cspurk
Copy link
Author

cspurk commented Jan 29, 2019

please indicate which views you are referring to

Not sure how they’re officially called but I guess any view would benefit. In particular I’m thinking about the search results view and the trace view.

@yogeshVU
Copy link

yogeshVU commented Jan 4, 2020

To add to this ticket, the time units to be displayed need to have a space after the number and before the time unit.

for example:

100 ms and not 100ms
200 s and not 200s

UI example in figure: https://github.com/jaegertracing/jaeger-ui/blob/master/media/ss_trace.png

I suppose this is as per the SI standards.
ref: https://english.stackexchange.com/questions/2794/punctuation-with-units

@yurishkuro
Copy link
Member

Looks like the fix can go to https://github.com/jaegertracing/jaeger-ui/blob/master/packages/jaeger-ui/src/utils/date.tsx#L92

@yogeshVU my -1 was about spacing. I think 7h 28m 24s 235ms or even 7h28m24s235ms is preferable over 7 h 28 m 24.23 s.

@jamesfer
Copy link
Contributor

jamesfer commented Oct 4, 2020

Hello there, I found this issue because I was looking for an issue to work on as my first contribution and this one seemed pretty easy.
I had some quick suggestions while I was implementing it though:

  1. Limit the number of units displayed to the 3 closest to the largest unit. So only display hours, minutes and seconds, or seconds, milliseconds and microseconds, or days, hours and minutes. I think it might be too much to include microseconds if the duration is 7 hours long, for example.
  2. Not include any units that are 0. If a duration is exactly 5 minutes, then we should display 5m instead of 5m 0s 0ms.
  3. Remove the inputUnit parameter from formatDate. I couldn't see the parameter used anywhere and it would simplify the formatDate implementation.

jamesfer added a commit to jamesfer/jaeger-ui that referenced this issue Oct 6, 2020
Expands the number of units that the formatDuration function displays.
Previously the function only used milliseconds and seconds to display
durations, now it will support all units up to days. This is to make
it easier to read very long durations in the UI that would have
previously only been displayed in seconds.

As a side effect of this change, there are a few changes to the way existing
durations are displayed:
* 0ms -> 0μs
* 0.15ms -> 150μs
* 1.7s -> 1s 700ms

Resolves jaegertracing#319

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>
jamesfer added a commit to jamesfer/jaeger-ui that referenced this issue Oct 7, 2020
Expands the number of units that the formatDuration function displays.
Previously the function only used milliseconds and seconds to display
durations, now it will support all units up to days. This is to make
it easier to read very long durations in the UI that would have
previously only been displayed in seconds.

As a side effect of this change, there are a few changes to the way existing
durations are displayed:
* 0ms -> 0μs
* 0.15ms -> 150μs
* 1.7s -> 1s 700ms

Resolves jaegertracing#319

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>
yurishkuro pushed a commit that referenced this issue Oct 7, 2020
* Add more units to duration formatting

Expands the number of units that the formatDuration function displays.
Previously the function only used milliseconds and seconds to display
durations, now it will support all units up to days. This is to make
it easier to read very long durations in the UI that would have
previously only been displayed in seconds.

As a side effect of this change, there are a few changes to the way existing
durations are displayed:
* 0ms -> 0μs
* 1.5μs
* 1.5ms
* 1.5s
* 1m 30s
* 1h 30m
* 1d 12h

Resolves #319

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Remove inputUnit parameter of formatDuration

The inputUnit parameter was not used anywhere and significantly
complicated the implementation of the formatDuration function.
Now, all inputs are assumed to be in microseconds which is consistent
with a few other methods in the date.tsx file.

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Reduce date format units to 2

Reduces the number of units displayed by the dateFormat function to
a maximum of 2. So "2d 5h 20m" will now be "2d 5h".

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Use decimals when formating μs, ms and s durations

This change will display durations less than a minute using decimals
as 1.3s is easier to comprehend than 1s 300ms as it was being
displayed before. Durations larger than a minute will still use multiple
units. Eg. 5m 27s

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Fix date.test.js licence

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this issue Jul 4, 2021
* Add more units to duration formatting

Expands the number of units that the formatDuration function displays.
Previously the function only used milliseconds and seconds to display
durations, now it will support all units up to days. This is to make
it easier to read very long durations in the UI that would have
previously only been displayed in seconds.

As a side effect of this change, there are a few changes to the way existing
durations are displayed:
* 0ms -> 0μs
* 1.5μs
* 1.5ms
* 1.5s
* 1m 30s
* 1h 30m
* 1d 12h

Resolves jaegertracing#319

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Remove inputUnit parameter of formatDuration

The inputUnit parameter was not used anywhere and significantly
complicated the implementation of the formatDuration function.
Now, all inputs are assumed to be in microseconds which is consistent
with a few other methods in the date.tsx file.

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Reduce date format units to 2

Reduces the number of units displayed by the dateFormat function to
a maximum of 2. So "2d 5h 20m" will now be "2d 5h".

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Use decimals when formating μs, ms and s durations

This change will display durations less than a minute using decimals
as 1.3s is easier to comprehend than 1s 300ms as it was being
displayed before. Durations larger than a minute will still use multiple
units. Eg. 5m 27s

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Fix date.test.js licence

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this issue Jul 4, 2021
* Add more units to duration formatting

Expands the number of units that the formatDuration function displays.
Previously the function only used milliseconds and seconds to display
durations, now it will support all units up to days. This is to make
it easier to read very long durations in the UI that would have
previously only been displayed in seconds.

As a side effect of this change, there are a few changes to the way existing
durations are displayed:
* 0ms -> 0μs
* 1.5μs
* 1.5ms
* 1.5s
* 1m 30s
* 1h 30m
* 1d 12h

Resolves jaegertracing#319

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Remove inputUnit parameter of formatDuration

The inputUnit parameter was not used anywhere and significantly
complicated the implementation of the formatDuration function.
Now, all inputs are assumed to be in microseconds which is consistent
with a few other methods in the date.tsx file.

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Reduce date format units to 2

Reduces the number of units displayed by the dateFormat function to
a maximum of 2. So "2d 5h 20m" will now be "2d 5h".

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Use decimals when formating μs, ms and s durations

This change will display durations less than a minute using decimals
as 1.3s is easier to comprehend than 1s 300ms as it was being
displayed before. Durations larger than a minute will still use multiple
units. Eg. 5m 27s

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Fix date.test.js licence

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this issue Jul 5, 2021
* Add more units to duration formatting

Expands the number of units that the formatDuration function displays.
Previously the function only used milliseconds and seconds to display
durations, now it will support all units up to days. This is to make
it easier to read very long durations in the UI that would have
previously only been displayed in seconds.

As a side effect of this change, there are a few changes to the way existing
durations are displayed:
* 0ms -> 0μs
* 1.5μs
* 1.5ms
* 1.5s
* 1m 30s
* 1h 30m
* 1d 12h

Resolves jaegertracing#319

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Remove inputUnit parameter of formatDuration

The inputUnit parameter was not used anywhere and significantly
complicated the implementation of the formatDuration function.
Now, all inputs are assumed to be in microseconds which is consistent
with a few other methods in the date.tsx file.

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Reduce date format units to 2

Reduces the number of units displayed by the dateFormat function to
a maximum of 2. So "2d 5h 20m" will now be "2d 5h".

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Use decimals when formating μs, ms and s durations

This change will display durations less than a minute using decimals
as 1.3s is easier to comprehend than 1s 300ms as it was being
displayed before. Durations larger than a minute will still use multiple
units. Eg. 5m 27s

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>

* Fix date.test.js licence

Signed-off-by: James Ferguson <jamesferguson497@gmail.com>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants