-
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
Change from INFO to INFO ALL to get Commandstats statistics) #2894 #2902
Conversation
…ta#2894 Added tests for influxdata#2894 Added documentation for influxdata#2894
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 great, just a very minor thing that really shouldn't ever happen:
if section == "Commandstats" { | ||
//#cmdstat_get:calls=63102137,usec=166854619,usec_per_call=2.64 | ||
tmp := strings.Split(line, ":") | ||
tmp_metrics := strings.Split(tmp[1], ",") |
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.
Check for the length of the splits before indexing, just in case the input is bad for some reason. In the case of not having a ":", call acc.AddError and continue.
tmp := strings.Split(line, ":") | ||
tmp_metrics := strings.Split(tmp[1], ",") | ||
for _, element := range tmp_metrics { | ||
mdata := strings.Split(element, "=") |
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.
Check length here too
for _, element := range tmp_metrics { | ||
mdata := strings.Split(element, "=") | ||
if ival, err := strconv.ParseInt(mdata[1], 10, 64); err == nil { | ||
fields[tmp[0]+mdata[0]] = ival |
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 would be good to separate tmp[0]
& mdata[0]
with a delimiter, such as _
.
…influxdata-master
@marek-knappe do you have time soon to address the feedback from daniel and phemmer? |
Closing, addressed in PR #5926 |
Added tests for #2894
Added documentation for #2894
Required for all PRs: