Use Go style conventions for variable name
This commit is contained in:
parent
417740738d
commit
4f115437e6
|
@ -254,10 +254,10 @@ func gatherInfoOutput(
|
|||
val := strings.TrimSpace(parts[1])
|
||||
|
||||
// Some percentage values have a "%" suffix that we need to get rid of before int/float conversion
|
||||
num_val := strings.TrimSuffix(val, "%")
|
||||
val = strings.TrimSuffix(val, "%")
|
||||
|
||||
// Try parsing as int
|
||||
if ival, err := strconv.ParseInt(num_val, 10, 64); err == nil {
|
||||
if ival, err := strconv.ParseInt(val, 10, 64); err == nil {
|
||||
switch name {
|
||||
case "keyspace_hits":
|
||||
keyspace_hits = ival
|
||||
|
@ -272,7 +272,7 @@ func gatherInfoOutput(
|
|||
}
|
||||
|
||||
// Try parsing as a float
|
||||
if fval, err := strconv.ParseFloat(num_val, 64); err == nil {
|
||||
if fval, err := strconv.ParseFloat(val, 64); err == nil {
|
||||
fields[metric] = fval
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue