Skip to content

Add the minute and hour units for duration formats#4621

Merged
julienw merged 2 commits into
firefox-devtools:mainfrom
fqueze:range-time-units
May 16, 2023
Merged

Add the minute and hour units for duration formats#4621
julienw merged 2 commits into
firefox-devtools:mainfrom
fqueze:range-time-units

Conversation

@fqueze

@fqueze fqueze commented May 16, 2023

Copy link
Copy Markdown
Contributor

When making very long (many hours, sometimes multiple days) profiles to understand power use, having the profile range displayed as a value of multiple thousand seconds is not user friendly.

Example long profile: https://profiler.firefox.com/public/xgdwbaq634je6227x9ar8y68ayfmzm3f9vty560/

@fqueze fqueze requested a review from canova May 16, 2023 05:48
@fqueze

fqueze commented May 16, 2023

Copy link
Copy Markdown
Contributor Author

It would also be nice to make the code in src/components/timeline/Ruler.js handle nicely profiles with long durations, but that code is more complicated to tweak so I think it could be done in a separate future pull request. I'm not even sure yet what the correct behavior would look like for what to display in the timeline ruler.

@codecov

codecov Bot commented May 16, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 71.42% and no project coverage change.

Comparison is base (6d11f8b) 88.62% compared to head (39f1162) 88.62%.

❗ Current head 39f1162 differs from pull request most recent head e55df6d. Consider uploading reports for the commit e55df6d to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4621   +/-   ##
=======================================
  Coverage   88.62%   88.62%           
=======================================
  Files         294      294           
  Lines       26090    26100   +10     
  Branches     7031     7038    +7     
=======================================
+ Hits        23122    23131    +9     
- Misses       2762     2763    +1     
  Partials      206      206           
Impacted Files Coverage Δ
src/utils/format-numbers.js 85.83% <71.42%> (-1.91%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@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 looks reasonable, thanks!

"duration - 12.346ms",
"duration - 123.46s",
"duration - 2.06min",
"duration - 34.3h",

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 for the tests!

@julienw julienw enabled auto-merge (squash) May 16, 2023 15:04
@julienw

julienw commented May 16, 2023

Copy link
Copy Markdown
Contributor

It would also be nice to make the code in src/components/timeline/Ruler.js handle nicely profiles with long durations, but that code is more complicated to tweak so I think it could be done in a separate future pull request. I'm not even sure yet what the correct behavior would look like for what to display in the timeline ruler.

Yeah, it's not clear to me either.
When looking at the whole range, this is easier, but once we zoom in, I'm not so sure.

@julienw julienw merged commit a859e50 into firefox-devtools:main May 16, 2023
@canova canova mentioned this pull request May 30, 2023
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