-
Notifications
You must be signed in to change notification settings - Fork 521
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 - Request rate number more readable #890
Monitor Tab - Request rate number more readable #890
Conversation
Signed-off-by: nofar9792 <[email protected]>
…o request-rate-two-decimal-places
…o request-rate-two-decimal-places
Codecov Report
@@ Coverage Diff @@
## main #890 +/- ##
==========================================
+ Coverage 95.37% 95.43% +0.05%
==========================================
Files 240 240
Lines 7462 7466 +4
Branches 1865 1866 +1
==========================================
+ Hits 7117 7125 +8
+ Misses 339 335 -4
Partials 6 6
Continue to review full report at Codecov.
|
} | ||
|
||
// Truncate number to two decimal places | ||
return `${value.toString().match(/^-?\d+(?:\.\d{0,2})?/)![0]} req/s`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this is not so much a question of decimal places, but of precision. E.g. 2.666667 is just as useless (too much precision) as 26666.67, but this code will allow the latter, whereas I would prefer to represent it as 26.6k - never more than 3 digits of precision
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point and totally accepted. However, will be better just to go this path right now, and just improve on another iteration. Your comment definitely enhances the solution, but the current step will already provide an improvement which is immediate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which problem is this PR solving?
Resolves #889
Short description of the changes
before:
![Screen Shot 2022-01-25 at 16 07 35](https://user-images.githubusercontent.com/11076023/155332955-c0bd0c5d-51e1-48a0-a891-ef6e19e59074.png)
after:
![image](https://user-images.githubusercontent.com/11076023/155334477-3f5b2873-e358-4443-8209-0d9ac81ed6fe.png)
before:
![Screen Shot 2022-01-25 at 16 13 00](https://user-images.githubusercontent.com/11076023/155333978-6318ed47-d533-428b-8703-81f0cd304869.png)
after:
![Screen Shot 2022-01-25 at 16 10 24](https://user-images.githubusercontent.com/11076023/155333998-a6430c1c-7415-48b2-9254-f4c64e1ce0dd.png)