Convert measurement names to snake_case

This commit is contained in:
Vebjorn Ljosa 2016-03-17 11:38:17 -04:00
parent 747edb09bf
commit 8ed7a7e401
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) acc.AddFields("couchbase_node", fields, tags)
} }
for bucketName, _ := range pool.BucketMap { for bucketName, _ := range pool.BucketMap {
bucket := pool.BucketMap[bucketName]
tags := map[string]string{"cluster": addr, "bucket": 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 return nil
} }