Skip to content
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

Merged
merged 2 commits into from
Aug 16, 2019

Conversation

adamflott
Copy link
Contributor

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@glinton
Copy link
Contributor

glinton commented May 30, 2019

There is already an open PR for this in #5874. What do you feel this adds that that one doesn't provide?

@adamflott
Copy link
Contributor Author

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 :)

@wingyplus
Copy link
Contributor

@adamflott your pr seems to be make sense than my opened pr. :)

plugins/inputs/redis/redis.go Outdated Show resolved Hide resolved
"usec": int64(990),
"usec_per_call": float64(990.0),
}
acc.AssertContainsTaggedFields(t, "redis_cmdstat", cmdstatCommandFields, cmdstatCommandTags)
Copy link
Contributor

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?

Copy link
Contributor

@glinton glinton Aug 5, 2019

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.

Copy link
Contributor Author

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

@glinton glinton added area/redis feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin labels Jun 27, 2019
@adamflott
Copy link
Contributor Author

@glinton any updates? I would like to see either #5874 or this PR get merged soon.

@glinton
Copy link
Contributor

glinton commented Aug 5, 2019

This likely won't make it into 1.12 as we're cramming trying to finish up what is already in the milestone. Because this is a basic change though, it is possible it gets into the 1.13 release Turns out this was in fact planned for 1.12, once the changes are made and this gets a final approval, it will be in the 1.12 release.

@glinton glinton added this to the 1.13.0 milestone Aug 5, 2019
plugins/inputs/redis/redis.go Outdated Show resolved Hide resolved
acc telegraf.Accumulator,
global_tags map[string]string,
) {
if strings.HasPrefix(name, "cmdstat") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return if !strings.HasPrefix

Copy link
Contributor Author

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)
Copy link
Contributor

@glinton glinton Aug 5, 2019

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.

@glinton
Copy link
Contributor

glinton commented Aug 5, 2019

Resolves #2894
Preferred over and closes #2902

@adamflott can you also document the additional fields this adds, similar to 2902

@glinton glinton modified the milestones: 1.13.0, 1.12.0 Aug 5, 2019
@glinton
Copy link
Contributor

glinton commented Aug 13, 2019

@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?

@adamflott
Copy link
Contributor Author

@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") {
Copy link
Contributor

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_") {

@danielnelson
Copy link
Contributor

The sentinel plugin will need to wait until 1.13, but the other should be able to make it.

@danielnelson danielnelson merged commit 96fa7fa into influxdata:master Aug 16, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redis feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants