-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
KIBANA-150302 fixed displaying sampling rate of N/A if there are no t… #191275
base: main
Are you sure you want to change the base?
Conversation
❌ Author of the following commits did not sign a Contributor Agreement: Please, read and sign the above mentioned agreement if you want to contribute to this project |
@@ -233,7 +233,7 @@ export async function getServiceStatistics({ | |||
sampledTransactionDocs / totalTransactionsPerService[serviceName], | |||
1 | |||
) | |||
: 0; | |||
: 'N/A'; |
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.
I think it might be better to return null
here. "N/A" is a presentational and locale-specific. It might be slightly more code if we returned null
here and made the UI display "N/A" or the appropriate string.
Let me know if I can help in any way with getting this done.
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.
cc @miltonhultgren do we have anything in our API guidelines about handling 0 vs. null/undefined?
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.
I agree that the API should not return a (localized) string in this situation (based on the API guidelines to separate API from UI presentation), and if this is meant to express a lack of a value then I would return a null/undefined (but this part is not stated in the guidelines).
This is for the reason that 0 may be a valid value in some cases, so it's risky to make 0 === N/A, while null is usually the standard invalid value.
Summary
Currently, the Storage Explorer displays a sampling rate of 0% if there are no transactions. This is misleading, as we can't actually infer what the sampling rate would be if there were transactions (which might not exist or might be dropped for whatever reason). We should instead display N/A.
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers