From 8ed7a7e401b7a7b6e542a1bc1f38c4280c5a679b Mon Sep 17 00:00:00 2001 From: Vebjorn Ljosa Date: Thu, 17 Mar 2016 11:38:17 -0400 Subject: [PATCH] Convert measurement names to snake_case --- plugins/inputs/couchbase/couchbase.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/couchbase/couchbase.go b/plugins/inputs/couchbase/couchbase.go index aff551b2e..7135be5a5 100644 --- a/plugins/inputs/couchbase/couchbase.go +++ b/plugins/inputs/couchbase/couchbase.go @@ -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 }