Skip to content

Show marker count next to the marker name in the marker chart when a marker is hovered.#4892

Merged
fqueze merged 1 commit into
firefox-devtools:mainfrom
fqueze:show-marker-count
Jan 31, 2024
Merged

Show marker count next to the marker name in the marker chart when a marker is hovered.#4892
fqueze merged 1 commit into
firefox-devtools:mainfrom
fqueze:show-marker-count

Conversation

@fqueze

@fqueze fqueze commented Jan 19, 2024

Copy link
Copy Markdown
Contributor

┆Issue is synchronized with this Jira Task

@fqueze fqueze changed the title Show marker count next to the marker name in the marker chart when a … [deploy preview] Show marker count next to the marker name in the marker chart when a marker is hovered. Jan 19, 2024
@codecov

codecov Bot commented Jan 19, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c1b4d06) 88.43% compared to head (751a214) 88.42%.

❗ Current head 751a214 differs from pull request most recent head dd0c6c5. Consider uploading reports for the commit dd0c6c5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4892      +/-   ##
==========================================
- Coverage   88.43%   88.42%   -0.01%     
==========================================
  Files         304      303       -1     
  Lines       27192    27143      -49     
  Branches     7329     7335       +6     
==========================================
- Hits        24047    24001      -46     
+ Misses       2927     2924       -3     
  Partials      218      218              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fqueze fqueze force-pushed the show-marker-count branch from 794829b to 751a214 Compare January 19, 2024 15:55
@fqueze fqueze requested a review from julienw January 19, 2024 16:00
@julienw julienw changed the title [deploy preview] Show marker count next to the marker name in the marker chart when a marker is hovered. Show marker count next to the marker name in the marker chart when a marker is hovered. Jan 25, 2024

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This works well, but there's a shortcoming: when we have several rows for one marker name, and the user hovers a marker on a row that's not the first one, I think we'd still want to see the total.
Otherwise as a user it's not clear that the count seen when hovering the first line actually contains all the markers or just the ones in the first line.

That said I understand this is more work: we need to redraw the label for another line that the one that's been hovered.
I'd like to hear your thoughts about that before approving more.

@fqueze

fqueze commented Jan 25, 2024

Copy link
Copy Markdown
Contributor Author

That said I understand this is more work: we need to redraw the label for another line that the one that's been hovered. I'd like to hear your thoughts about that before approving more.

I agree the experience in this case is not perfect. I didn't try to fix it exactly for the reason you mentioned, it would involve redrawing another line, and I wasn't sure I wanted to start doing that (or if I instead made it redraw the entire set of rows related to the hovered markers, it could be slow when we have many nested markers).

I think hovering the marker name itself is also a case where displaying the marker count would make sense, but it can be left for a follow-up. I still think a better long term solution might be to show a tooltip when hovering the marker name, and use this new UI area to display a lot more information (eg. marker frequency, total duration, median duration, ...).

@julienw

julienw commented Jan 25, 2024

Copy link
Copy Markdown
Contributor

But we don't need to redraw the full first line, only its label.
But then also of course your logic to count the markers should change too. Probably that logic would get a bit too complex to stay where it is and it would be good to extract it to a separate method.
If you can look at it that would be really great, otherwise I can take a stab at it tomorrow.

I also like your suggestion of a tooltip on the marker name, although we'd still need something different in the active tab view where we hide the name on hover to show the possible underlying markers...

@fqueze fqueze requested a review from julienw January 30, 2024 15:25

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this looks good but I believe it would be better to extract the algorithm for more clarity. Please tell me if you don't approve.

Comment thread src/components/marker-chart/Canvas.js Outdated
Comment on lines +593 to +607
if (drawMarkerCount) {
let count = markerTiming.length;
for (
let row = rowIndex + 1;
row < markerTimingAndBuckets.length;
++row
) {
if (
typeof markerTimingAndBuckets[row] === 'string' ||
markerTimingAndBuckets[row].name !== name
) {
break;
}
count += markerTimingAndBuckets[row].length;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it worth extracting the algorithm to compute the marker count to a separate method?
countMarkerInBucketStartingAtRow(rowIndex)

@fqueze fqueze force-pushed the show-marker-count branch from 751a214 to dd0c6c5 Compare January 31, 2024 12:58
@fqueze fqueze enabled auto-merge (squash) January 31, 2024 13:00
@fqueze fqueze merged commit e29cbe2 into firefox-devtools:main Jan 31, 2024
@julienw julienw mentioned this pull request Feb 6, 2024
julienw added a commit that referenced this pull request Feb 6, 2024
[@canova Nazım Can Altınova] Return null instead of throwing an error if it fails to get the resource name in active tab view (#4905)
[@fqueze Florian Quèze] Improve the precision of the getFittedText implementation. (#4893)
[@fqueze Florian Quèze] Show marker count next to the marker name in the marker chart when a marker is hovered. (#4892)
[@mstange Markus Stange] Convert some code to use the non-inverted call node table even while we're showing the inverted call tree (Merge PR #4899)
[@canova Nazım Can Altınova] Bring the max stacking depth limit back for marker timings (#4898)
[@mstange Markus Stange] Various preparations in call tree code for fast inverted tree (Merge PR #4897)
[@mstange Markus Stange] Move call node path/index conversion functions into CallNodeInfo (Merge PR #4896)
[@mstange Markus Stange] Make mergeFunction fast (Merge PR #4895)
[@gthb Gunnlaugur Thor Briem] feat: support from-url profiles in compare (#4875)

And all the locale contributors:
de: Michael Köhler
el: Jim Spentzos
en-GB: Ian Neal
es-CL: ravmn
fr: Théo Chevalier
fy-NL: Fjoerfoks
ia: Melo46
it: Francesco Lodolo [:flod]
nl: Fjoerfoks, Mark Heijl
pt-BR: Marcelo Ghelman
ru: Valery Ledovskoy
sv-SE: Andreas Pettersson
uk: Artem Polivanchuk
zh-CN: 你我皆凡人, Olvcpr423, Pontoon
zh-TW: Pin-guang Chen
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.

2 participants