-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Capture and parse the cmdstat timings from INFO ALL
command
#5926
Conversation
There is already an open PR for this in #5874. What do you feel this adds that that one doesn't provide? |
Oops! Didn't see that. The only difference is, their PR does 2 remote calls, and mine does 1. Either way, I don't care which one is merged, just that it is :) |
@adamflott your pr seems to be make sense than my opened pr. :) |
"usec": int64(990), | ||
"usec_per_call": float64(990.0), | ||
} | ||
acc.AssertContainsTaggedFields(t, "redis_cmdstat", cmdstatCommandFields, cmdstatCommandTags) |
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.
Should we needs to add test in case that usec and usec_per_call are not number?
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 this is something that may be returned, let's test for and handle it.
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.
Is there a pattern from testutil I could use?
FWIW, I don't expect the type to change given the age of this commit :)
redis/redis@d7ed7fd
|
plugins/inputs/redis/redis.go
Outdated
acc telegraf.Accumulator, | ||
global_tags map[string]string, | ||
) { | ||
if strings.HasPrefix(name, "cmdstat") { |
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.
return
if !strings.HasPrefix
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.
done
"usec": int64(990), | ||
"usec_per_call": float64(990.0), | ||
} | ||
acc.AssertContainsTaggedFields(t, "redis_cmdstat", cmdstatCommandFields, cmdstatCommandTags) |
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 this is something that may be returned, let's test for and handle it.
Resolves #2894 @adamflott can you also document the additional fields this adds, similar to 2902 |
@adamflott not sure if you saw, but I was mistaken when i mentioned this would be pushed off until 1.13. Do you foresee yourself getting time to address the latest feedback? |
I can have this PR done by the end of tomorrow 8/14 EST. I also have 2 other PRs around Redis I have vested interest in getting merged in
Any way I can get those reviewed? |
acc telegraf.Accumulator, | ||
global_tags map[string]string, | ||
) { | ||
if !strings.HasPrefix(name, "cmdstat") { |
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.
Nitpick, but I would add an underscore to match the TrimPrefix laster on:
- if !strings.HasPrefix(name, "cmdstat") {
+ if !strings.HasPrefix(name, "cmdstat_") {
The sentinel plugin will need to wait until 1.13, but the other should be able to make it. |
Required for all PRs: