hypertrace / hypertrace-ui

UI for Hypertrace
Other
25 stars 12 forks source link

fix(time-duration): Time Duration Most Significant adjusted to not have approax value #2589

Open rahul-p-rajesh opened 11 months ago

rahul-p-rajesh commented 11 months ago

Description

Problem: On Providing an input like 44H, the output is 1 day. Fix: Added an allowApproxUnit flag which on false keeps on checking the for time unit which is not approximate.

Checklist:

github-actions[bot] commented 11 months ago

Test Results

    4 files  ±0    316 suites  ±0   32m 36s :stopwatch: +3s 1 136 tests ±0  1 136 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  1 146 runs  ±0  1 146 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit f15d131e. ± Comparison against base commit 389047b0.

:recycle: This comment has been updated with latest results.

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (389047b) 81.69% compared to head (f15d131) 81.70%. Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2589 +/- ## ======================================= Coverage 81.69% 81.70% ======================================= Files 928 928 Lines 20790 20793 +3 Branches 3136 3139 +3 ======================================= + Hits 16984 16988 +4 + Misses 3665 3664 -1 Partials 141 141 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

aaron-steinfeld commented 11 months ago

Problem: On Providing an input like 44H, the output is 1 day. Fix: Added an allowApproxUnit flag which on false keeps on checking the for time unit which is not approximate

That's the whole point of the function though. In that example, 'day' is the most significant unit. The behavior you're describing is something else, so we shouldn't overload the existing function with a boolean flag (code smell!). We'd want a whole new function. That said, given we already can represent this as a 1d20h and as 1d, do we really need a third representation? The UX consistency here is concerning.