-
Notifications
You must be signed in to change notification settings - Fork 42
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
fix: add guidance re usage query count #6910
Conversation
@@ -39,6 +44,10 @@ const UsageSingleStat: FC<Props> = ({ | |||
decimalPlaces: {isEnforced: false, digits: 0}, | |||
} | |||
|
|||
// Adjusts table properties to warn user that only flux queries are included in the Query Count. | |||
const isQueryCount: Boolean = usageVector.name === VectorName.QueryCount | |||
const vectorName = isQueryCount ? 'Query Count (Flux Only)' : usageVector.name |
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.
This overrides the default backend-provided vector name.
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.
Looks good, but I did have one suggestion to mitigate future issues.
src/usage/context/usage.tsx
Outdated
export enum VectorName { | ||
QueryCount = 'Query Count', | ||
Storage = 'Storage', | ||
DataIn = 'Data In', | ||
DataOut = 'Data Out', | ||
} |
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.
If we're only using 'Query Count'
today, I think we're better off either inlining the 'Query Count'
string in /src/usage/UsageSingleStat.tsx
or exporting a const QueryCount = 'Query Count'
here instead. Otherwise, we're maintaining the other vector names without any confirmation that they're correct, which could lead to someone mistakenly relying on their accuracy in the future.
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.
That's a good point -- this was really anticipating future use since I wasn't happy with the fact that we don't identify the actual string values anywhere in the UI. But there is no need for any of the enum values other than QueryCount
now.
4679df5
to
60ecec8
Compare
Amended commit addresses @eatondustin1 's comment above ^ |
@@ -2,7 +2,7 @@ import {Organization} from '../../../src/types' | |||
|
|||
const statHeaders = [ | |||
'Data In (MB)', | |||
'Query Count', | |||
'Query Count (Flux Only) ?', |
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 just noticed the ?
here - doesn't the tooltip element cover that?
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.
This is a change I identified after running the ui integration tests, which failed without the change. This is part of a test that designates what text to look for in the header. QuestionMarkToolip
is a Clockface component that, among other things, renders and formats a ?
as text wherever the component is rendered. As a result, the test needed to be updated to address the fact that the text within the header now includes that ?.
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.
Ah, that makes sense, thanks for the explanation!
Clarifies that the query count on the C2 usage page reflects flux queries only.
Checklist
Authors and Reviewer(s), please verify the following: