diff --git a/ceilometer/storage/impl_hbase.py b/ceilometer/storage/impl_hbase.py index 6c2fe866..16e63f57 100644 --- a/ceilometer/storage/impl_hbase.py +++ b/ceilometer/storage/impl_hbase.py @@ -55,7 +55,7 @@ class Connection(hbase_base.Connection, base.Connection): - meter (describes sample actually): - - row-key: consists of reversed timestamp, meter and a message signature + - row-key: consists of reversed timestamp, meter and a message uuid for purposes of uniqueness - Column Families: @@ -175,9 +175,9 @@ class Connection(hbase_base.Connection, base.Connection): resource, ts) # Rowkey consists of reversed timestamp, meter and a - # message signature for purposes of uniqueness + # message uuid for purposes of uniqueness row = hbase_utils.prepare_key(data['counter_name'], rts, - data['message_signature']) + data['message_id']) record = hbase_utils.serialize_entry( data, **{'source': data['source'], 'rts': rts, 'message': data, 'recorded_at': timeutils.utcnow()}) diff --git a/ceilometer/tests/storage/test_storage_scenarios.py b/ceilometer/tests/storage/test_storage_scenarios.py index 9e715330..b7cae213 100644 --- a/ceilometer/tests/storage/test_storage_scenarios.py +++ b/ceilometer/tests/storage/test_storage_scenarios.py @@ -553,9 +553,8 @@ class RawSampleTest(DBTestBase, def test_get_samples_by_resource(self): f = storage.SampleFilter(user='user-id', resource='resource-id') results = list(self.conn.get_samples(f)) - self.assertIsNotEmpty(results) - meter = results[1] - d = meter.as_dict() + self.assertEqual(2, len(results)) + d = results[1].as_dict() self.assertEqual(timeutils.utcnow(), d['recorded_at']) del d['recorded_at'] self.assertEqual(self.msgs[0], d)