Skip to content

Add a "Sample timestamp" field to the sample tooltip in timeline#5322

Merged
canova merged 2 commits into
firefox-devtools:mainfrom
canova:sample-graph-tooltip-time
Jan 17, 2025
Merged

Add a "Sample timestamp" field to the sample tooltip in timeline#5322
canova merged 2 commits into
firefox-devtools:mainfrom
canova:sample-graph-tooltip-time

Conversation

@canova

@canova canova commented Jan 16, 2025

Copy link
Copy Markdown
Member

Fixes #5319.

This also came up from a review comment here: #5298 (comment)

It sounds like a good idea to add the sample time to the sample tooltips. So 1) it will be more explicit that this is indeed a single sample. 2) It could be useful to know the precise time of a sample, so we can potentially compare different samples.

Apparently this component wasn't localized. So I filed #5321 for that. I'm not so sure if we should really localize it right now, because I think last time we discussed, we were saying that if we have <label>: <value> data in a view and value itself is not localized, maybe we shouldn't localize the label either. But I'm open to suggestions. I think this can be done outside of this PR.

Deploy preview / production

Example screenshot:
Screenshot 2025-01-17 at 11 42 29 AM

@canova canova requested a review from julienw January 16, 2025 10:31
@codecov

codecov Bot commented Jan 16, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.08%. Comparing base (9175e24) to head (b49933a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5322   +/-   ##
=======================================
  Coverage   86.08%   86.08%           
=======================================
  Files         311      311           
  Lines       29678    29683    +5     
  Branches     8190     8192    +2     
=======================================
+ Hits        25548    25553    +5     
  Misses       3548     3548           
  Partials      582      582           

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

@mstange

mstange commented Jan 16, 2025

Copy link
Copy Markdown
Contributor

I worry that "Sample time" is ambiguous and might lead people to believe that it means "sample duration".

How do you feel about these alternatives?

  • Sample timestamp: <time>
  • Sample collected at <time>
  • Sampled at <time>

@canova canova force-pushed the sample-graph-tooltip-time branch 3 times, most recently from 1e31ed5 to b49933a Compare January 17, 2025 10:41
@canova

canova commented Jan 17, 2025

Copy link
Copy Markdown
Member Author

I worry that "Sample time" is ambiguous and might lead people to believe that it means "sample duration".

How do you feel about these alternatives?

* `Sample timestamp: <time>`

* `Sample collected at <time>`

* `Sampled at <time>`

Yeah, you're right about it being ambiguous. I think I would prefer Sample timestamp: <time> out of these 3, to keep this <label>: <value> unanimity in the tooltip. Changed the PR to reflect that. Thanks for the feedback!

@canova canova changed the title Add a "Sample time" field to the sample tooltip in timeline Add a "Sample timestamp" field to the sample tooltip in timeline Jan 17, 2025
@julienw

julienw commented Jan 17, 2025

Copy link
Copy Markdown
Contributor

I have a different suggestion (sorry!).
I'm thinking of something that could be reused in the marker tooltip, so that it would be consistent across the UI.

I have this niche prior art in subsurface, an open source diving program:
image

The "@" part is the timestamp of the dive that my mouse is currently hovering.

I think that simply @ is not that clear. But what about At: ?

@canova

canova commented Jan 17, 2025

Copy link
Copy Markdown
Member Author

I have a different suggestion (sorry!).

I'm thinking of something that could be reused in the marker tooltip, so that it would be consistent across the UI.

I have this niche prior art in subsurface, an open source diving program:

image

The "@" part is the timestamp of the dive that my mouse is currently hovering.

I think that simply @ is not that clear. But what about At: ?

Sharing things between components is probably fine. But the reason @fqueze suggested adding this was to make it even more obvious "what" this tooltip belonged to. This way people will see "sample" at first and won't have to think what tooltip this is. I don't think removing "sample" and only leaving "at" solves this problem.

@julienw

julienw commented Jan 17, 2025

Copy link
Copy Markdown
Contributor

Ah ok I see, it makes sense too.

Then I think I'd mildly prefer Sample at: (with the semicolon) because it's smaller, but I'll leave it up to you to decide.

@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.

thanks!

Now that we have this timestamp in the tooltip, it's pretty clear that sometimes the sample tooltip's timestamp and the selection's timestamp don't agree completely, see below:
image
Some hit testing logic may be buggy or just not the same, but it would be good to understand eventually...

Comment thread src/components/shared/SampleTooltipContents.js
Comment thread src/components/shared/SampleTooltipContents.js Outdated
Comment thread src/components/shared/SampleTooltipContents.js Outdated
Comment thread src/components/shared/SampleTooltipContents.js Outdated
@canova canova force-pushed the sample-graph-tooltip-time branch from b49933a to 264528a Compare January 17, 2025 15:05
@canova

canova commented Jan 17, 2025

Copy link
Copy Markdown
Member Author

Thanks, for the review. I merged your and Markus' suggestions and renamed it to Sampled at:.

Now that we have this timestamp in the tooltip, it's pretty clear that sometimes the sample tooltip's timestamp and the selection's timestamp don't agree completely, see below:

Some hit testing logic may be buggy or just not the same, but it would be good to understand eventually...

Hm, there could be multiple samples in a pixel and the way we choose these hovered samples could be different. But it's worth taking a look.

@julienw

julienw commented Jan 17, 2025

Copy link
Copy Markdown
Contributor

Hm, there could be multiple samples in a pixel and the way we choose these hovered samples could be different. But it's worth taking a look.

yeah that might be just that. In the screenshot the different might look big but it may not be that big depending on the zoom level (I didn't do the math).

@canova canova enabled auto-merge (squash) January 17, 2025 15:55
@canova canova merged commit a28d057 into firefox-devtools:main Jan 17, 2025
@canova canova deleted the sample-graph-tooltip-time branch January 17, 2025 18:26
@canova canova mentioned this pull request Jan 30, 2025
canova added a commit that referenced this pull request Jan 30, 2025
Updates:

[Julien Wajsberg] Some more small refactorings (#5320)
[Markus Stange] Pass the correct sample index offset to
getTimingsForCallNodeIndex for the flame graph tooltip. (#5328)
[Nisarg Jhaveri] Update docs to include Android Studio/Simpleperf trace
file support (#5309)
[Markus Stange] Don't pass the preview filtered thread to
getTimingsForPath/CallNodeIndex. (#5329)
[Nazım Can Altınova] Add a "Sample timestamp" field to the sample
tooltip in timeline (#5322)
[Markus Stange] Reduce confusion between call tree summary strategy
aware samples and regular samples (#5330)
[Markus Stange] Rename this getCounter selector to getCounters. (#5337)
[Markus Stange] Make sample indexes compatible between the unfiltered
and (preview) filtered call tree summary strategy samples when using an
allocation strat>
[Markus Stange] Remove some code that uses the preview filtered thread
(#5336)
[Markus Stange] Remove getMarkerSchemaName special cases - look up
marker schemas from data.type and nothing else (#5293)
[Markus Stange] Remove the makeProfileSerializable step - make the raw
in-memory profile match the format that's stored in the file (#5287)
[Nicolas Chevobbe] Adapt FilterNavigatorBar to High Contrast Mode.
(#5257)
[Nicolas Chevobbe] Adapt Tracks to High Contrast Mode. (#5252)
[Markus Stange] Adjust string index fields in markers when merging
threads (#5344)
[Theodoros Nikolaou] Localize title and aria label in ProfileName
(#5345)
[Julien Wajsberg] Adapt time-slice selection in High Contrast Mode.
(#5259)
[Markus Stange] Make stackTable (sub)category derived data (#5342)
[Markus Stange] Compute cpuRatio values when computing the derived
thread (#5288)
[Nazım Can Altınova] Add a context menu item to open the JS scripts in
DevTools debugger (#5295)

Also thanks to our localizers:

el: Jim Spentzos
fr: Théo Chevalier
it: Francesco Lodolo [:flod]
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.

Consider adding "Sample time: " to the sample tooltips in the sample graph to make it more explicit that it's a sample

3 participants