Convert measurement names to snake_case

This commit is contained in:
Vebjorn Ljosa 2016-03-17 11:38:17 -04:00 committed by Cameron Sparr
parent 681e695170
commit 2ddda6457f
1 changed files with 10 additions and 2 deletions

View File

@ -75,9 +75,17 @@ func (r *Couchbase) gatherServer(addr string, acc telegraf.Accumulator) error {
acc.AddFields("couchbase_node", fields, tags)
}
for bucketName, _ := range pool.BucketMap {
bucket := pool.BucketMap[bucketName]
tags := map[string]string{"cluster": addr, "bucket": bucketName}
acc.AddFields("couchbase_bucket", bucket.BasicStats, tags)
bs := pool.BucketMap[bucketName].BasicStats
fields := make(map[string]interface{})
fields["quota_percent_used"] = bs["quotaPercentUsed"]
fields["ops_per_sec"] = bs["opsPerSec"]
fields["disk_fetches"] = bs["diskFetches"]
fields["item_count"] = bs["itemCount"]
fields["disk_used"] = bs["diskUsed"]
fields["data_used"] = bs["dataUsed"]
fields["mem_used"] = bs["memUsed"]
acc.AddFields("couchbase_bucket", fields, tags)
}
return nil
}