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

Monitor Tab: Cannot see the whole numbers in the legend #873

Merged
merged 19 commits into from
Mar 1, 2022

Conversation

nofar9792
Copy link
Contributor

@nofar9792 nofar9792 commented Jan 26, 2022

Signed-off-by: nofar9792 [email protected]

Which problem is this PR solving?

Resolves #871

Short description of the changes

Convert the duration to a suitable time unit

Before Change:
Screen Shot 2022-02-20 at 12 44 25

After Change:
Screen Shot 2022-02-27 at 17 43 25

In order to find the suitable time unit, I find the max value, and then I use this time unit and convert the y-axis ticks.
Furthermore, I did a small refactor to timeConversion - use moment when I can and do all the calculation by myself

added brackets instead of comma:
image

@nofar9792 nofar9792 marked this pull request as ready for review January 26, 2022 16:57
@albertteoh
Copy link
Contributor

@nofar9792 can you please share a screenshot of what the graph and y-axis labels look like after these changes?

@codecov
Copy link

codecov bot commented Feb 20, 2022

Codecov Report

Merging #873 (c283c1b) into main (161a661) will increase coverage by 0.01%.
The diff coverage is 94.87%.

❗ Current head c283c1b differs from pull request most recent head 17e560b. Consider uploading reports for the commit 17e560b to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #873      +/-   ##
==========================================
+ Coverage   95.27%   95.29%   +0.01%     
==========================================
  Files         240      240              
  Lines        7475     7495      +20     
  Branches     1868     1870       +2     
==========================================
+ Hits         7122     7142      +20     
  Misses        347      347              
  Partials        6        6              
Impacted Files Coverage Δ
...c/components/Monitor/ServicesView/serviceGraph.tsx 98.07% <ø> (ø)
...r-ui/src/components/Monitor/ServicesView/index.tsx 97.02% <86.66%> (-1.85%) ⬇️
packages/jaeger-ui/src/reducers/metrics.mock.js 100.00% <100.00%> (ø)
packages/jaeger-ui/src/reducers/metrics.tsx 100.00% <100.00%> (ø)
packages/jaeger-ui/src/utils/date.tsx 94.66% <100.00%> (+0.30%) ⬆️
...nents/TracePage/TraceTimelineViewer/SpanBarRow.tsx 100.00% <0.00%> (+5.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 161a661...17e560b. Read the comment docs.

@nofar9792
Copy link
Contributor Author

@nofar9792 can you please share a screenshot of what the graph and y-axis labels look like after these changes?

Thanks Albert, I added 🙏

@nofar9792
Copy link
Contributor Author

@AlonMiz

@nofar9792
Copy link
Contributor Author

@yurishkuro ?

@yurishkuro
Copy link
Member

Are the before/after screenshots still accurate? I was expecting to see axis ticks like 1s, 2s, not to have Sec added to the axis title.

@nofar9792
Copy link
Contributor Author

Are the before/after screenshots still accurate? I was expecting to see axis ticks like 1s, 2s, not to have Sec added to the axis title.

We think it's redundant to write it in the ticks
@afishler

@albertteoh
Copy link
Contributor

We think it's redundant to write it in the ticks

What about when latencies are 1ms or 1hr?

@afishler-zz
Copy link

We think it's redundant to write it in the ticks

What about when latencies are 1ms or 1hr?

Well, they cannot be different units on the same diagram. Once the units are set they will be the same for the whole diagram.

That's why putting the units in the title should be enough. So if the function sets the units to ms it will be all ms, if it is seconds it will be all seconds
Screenshot at Feb 23 17-57-40

@albertteoh
Copy link
Contributor

That's why putting the units in the title should be enough. So if the function sets the units to ms it will be all ms, if it is seconds it will be all seconds

Ah, I see, so the title's units are dynamic based on the latency data. If that's the case, it makes sense to me.

Signed-off-by: nofar9792 <[email protected]>
@nofar9792
Copy link
Contributor Author

That's why putting the units in the title should be enough. So if the function sets the units to ms it will be all ms, if it is seconds it will be all seconds

Ah, I see, so the title's units are dynamic based on the latency data. If that's the case, it makes sense to me.

@yurishkuro @albertteoh so WDYT?

Signed-off-by: nofar9792 <[email protected]>
@nofar9792 nofar9792 changed the title Fix Bug: Cannot see the whole numbers in the legend Monitor Tab: Cannot see the whole numbers in the legend Feb 24, 2022
Comment on lines 44 to 48
milliseconds: 'ms',
seconds: 'Sec',
minutes: 'Min',
hours: 'Hrs',
days: 'Days',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel these should be consistent in case and plurality. Maybe, ms, sec, min, hr, day.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just occurred to me that min could unfortunately be confused with "minimum", so it's worth considering the plural form: ms, secs, mins, hrs, days.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if (shortTimeUnit) return shortTimeUnit;

return '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what conditions would timeUnit not be in timeUnitToShortTermMapper?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i don't haveshortTimeUnit, I don't want to return undefined

@@ -40,6 +40,14 @@ const UNIT_STEPS: { unit: string; microseconds: number; ofPrevious: number }[] =
{ unit: 'μs', microseconds: 1, ofPrevious: 1000 },
];

const timeUnitToShortTermMapper = {
milliseconds: 'ms',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't microseconds supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moment.js doesn't support it and in my cases (the only usages), we don't need microseconds

@@ -249,12 +270,13 @@ export class MonitorATMServicesViewImpl extends React.PureComponent<TProps, Stat
metrics.serviceError.service_latencies_95
}
loading={metrics.loading}
name="Latency, ms"
name={`Latency, ${convertTimeUnitToShortTerm(displayTimeUnit)}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer putting the units in brackets like "Latency (ms)" or "Latency (min)", instead of a comma.

What do you/others think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

nofar9792 added 2 commits February 27, 2022 17:33
Signed-off-by: nofar9792 <[email protected]>
Signed-off-by: nofar9792 <[email protected]>
albertteoh
albertteoh previously approved these changes Feb 28, 2022
Copy link
Contributor

@albertteoh albertteoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, thanks! It looks like there are some code coverage issues that need addressing.

@albertteoh
Copy link
Contributor

Just noticed, the description's "After" screenshot shows "Latency (s)" and the scale on the left goes up to a max 390.

I would have expected the units to be minutes already?

@nofar9792
Copy link
Contributor Author

Just noticed, the description's "After" screenshot shows "Latency (s)" and the scale on the left goes up to a max 390.

I would have expected the units to be minutes already?

This data is different

@nofar9792
Copy link
Contributor Author

@albertteoh @yurishkuro What prevents us from merging it

@yurishkuro
Copy link
Member

@albertteoh can you finish the review for this?

@albertteoh albertteoh merged commit f605ad6 into jaegertracing:main Mar 1, 2022
@nofar9792 nofar9792 deleted the fix-legend-numbers branch March 10, 2022 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Monitor Tab: Numbers in the Legend
4 participants