formatted code

This commit is contained in:
Tyler Nisonoff 2015-10-17 21:07:25 -07:00
parent 5957af19fc
commit c0d3864c68
1 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ func gatherInfoOutput(
acc plugins.Accumulator, acc plugins.Accumulator,
tags map[string]string, tags map[string]string,
) error { ) error {
var keyspace_hits, keyspace_misses uint64 = 0,0 var keyspace_hits, keyspace_misses uint64 = 0, 0
scanner := bufio.NewScanner(rdr) scanner := bufio.NewScanner(rdr)
for scanner.Scan() { for scanner.Scan() {
@ -210,7 +210,7 @@ func gatherInfoOutput(
} }
var keyspace_hitrate float64 = 0.0 var keyspace_hitrate float64 = 0.0
if keyspace_hits != 0 || keyspace_misses != 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) fmt.Println(keyspace_hitrate)
acc.Add("keyspace_hitrate", keyspace_hitrate, tags) acc.Add("keyspace_hitrate", keyspace_hitrate, tags)