diff --git a/plugins/redis/redis.go b/plugins/redis/redis.go index 786d7b284..4f4d87f9a 100644 --- a/plugins/redis/redis.go +++ b/plugins/redis/redis.go @@ -159,7 +159,7 @@ func gatherInfoOutput( acc plugins.Accumulator, tags map[string]string, ) error { - var keyspace_hits, keyspace_misses uint64 = 0,0 + var keyspace_hits, keyspace_misses uint64 = 0, 0 scanner := bufio.NewScanner(rdr) for scanner.Scan() { @@ -210,7 +210,7 @@ func gatherInfoOutput( } var keyspace_hitrate float64 = 0.0 if keyspace_hits != 0 || keyspace_misses != 0 { - keyspace_hitrate = float64(keyspace_hits) / float64(keyspace_hits + keyspace_misses) + keyspace_hitrate = float64(keyspace_hits) / float64(keyspace_hits+keyspace_misses) } fmt.Println(keyspace_hitrate) acc.Add("keyspace_hitrate", keyspace_hitrate, tags)