From Fedora Project Wiki

Revision as of 15:31, 2 April 2013 by Eglynn (talk | contribs) (Created page with "Ceilometer uses mongoDB by default to store metering data (though storage drivers are also supported for sqlalchemy and more recently for HBase too). In this test we use the ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Ceilometer uses mongoDB by default to store metering data (though storage drivers are also supported for sqlalchemy and more recently for HBase too).

In this test we use the mongo client to explore the metering store:

 mongo ceilometer

Show the available collections:

 > show collections
 meter
 project
 resource
 system.indexes
 user

Note the default indices:

 > db.system.indexes.find()
 { "v" : 1, "key" : { "_id" : 1 }, "ns" : "ceilometer.resource", "name" : "_id_" }
 { "v" : 1, "key" : { "user_id" : 1, "source" : 1 }, "ns" : "ceilometer.resource", "name" : "resource_idx" }
 { "v" : 1, "key" : { "_id" : 1 }, "ns" : "ceilometer.meter", "name" : "_id_" }
 { "v" : 1, "key" : { "resource_id" : 1, "user_id" : 1, "counter_name" : 1, "timestamp" : 1, "source" : 1 },
   "ns" : "ceilometer.meter", "name" : "meter_idx" }
 { "v" : 1, "key" : { "_id" : 1 }, "ns" : "ceilometer.user", "name" : "_id_" }
 { "v" : 1, "key" : { "_id" : 1 }, "ns" : "ceilometer.project", "name" : "_id_" }

Show the cpu_util samples retrived earlier via the ceilometer CLI, sorted in ascending time-order:

 > db.meter.find({'counter_name': 'cpu_util', 'resource_id' : $INSTANCE_ID}).sort({'timestamp': 1})
 { "_id" : ObjectId("515af62a1a63121d32eaa00c"), "counter_name" : "cpu_util", "user_id" : ...