diff --git a/ceilometer/collector/manager.py b/ceilometer/collector/manager.py index 33b15a75..17048f80 100644 --- a/ceilometer/collector/manager.py +++ b/ceilometer/collector/manager.py @@ -82,11 +82,12 @@ class CollectorManager(manager.Manager): """ #LOG.info('metering data: %r', data) LOG.info('metering data %s for %s: %s', - data['event_type'], + data['counter_name'], data['resource_id'], data['counter_volume']) if not meter.verify_signature(data): - LOG.warning('message signature invalid, discarding message') + LOG.warning('message signature invalid, discarding message: %r', + data) else: try: self.storage_conn.record_metering_data(data) diff --git a/ceilometer/meter.py b/ceilometer/meter.py index 1e4471f8..6bc49d93 100644 --- a/ceilometer/meter.py +++ b/ceilometer/meter.py @@ -78,8 +78,6 @@ def meter_message_from_counter(counter): 'counter_duration': counter.duration, 'resource_metadata': counter.resource_metadata, 'message_id': str(uuid.uuid1()), - # This field is used by the notification system. - 'event_type': '%s.%s' % (cfg.CONF.metering_topic, counter.type), } msg['message_signature'] = compute_signature(msg) return msg diff --git a/ceilometer/storage/impl_log.py b/ceilometer/storage/impl_log.py index 5ccfcd1b..16dfd184 100644 --- a/ceilometer/storage/impl_log.py +++ b/ceilometer/storage/impl_log.py @@ -52,6 +52,6 @@ class Connection(base.Connection): ceilometer.meter.meter_message_from_counter """ LOG.info('metering data %s for %s: %s', - data['event_type'], + data['counter_name'], data['resource_id'], data['counter_volume']) diff --git a/tests/collector/test_manager.py b/tests/collector/test_manager.py index 317990c1..5806b258 100644 --- a/tests/collector/test_manager.py +++ b/tests/collector/test_manager.py @@ -36,7 +36,7 @@ class TestCollectorManager(test.TestCase): self.ctx = context.RequestContext("user", "project") def test_valid_message(self): - msg = {'event_type': 'test', + msg = {'counter_name': 'test', 'resource_id': self.id(), 'counter_volume': 1, } @@ -50,7 +50,7 @@ class TestCollectorManager(test.TestCase): self.mox.VerifyAll() def test_invalid_message(self): - msg = {'event_type': 'test', + msg = {'counter_name': 'test', 'resource_id': self.id(), 'counter_volume': 1, } diff --git a/tests/storage/test_impl_log.py b/tests/storage/test_impl_log.py index c02ac142..a0e1dde3 100644 --- a/tests/storage/test_impl_log.py +++ b/tests/storage/test_impl_log.py @@ -28,7 +28,7 @@ def test_get_connection(): conf.metering_storage_engine = 'log' log_stg = impl_log.LogStorage() conn = log_stg.get_connection(conf) - conn.record_metering_data({'event_type': 'test', + conn.record_metering_data({'counter_name': 'test', 'resource_id': __name__, 'counter_volume': 1, }) diff --git a/tests/test_meter.py b/tests/test_meter.py index ef921cf4..b2290c86 100644 --- a/tests/test_meter.py +++ b/tests/test_meter.py @@ -134,11 +134,6 @@ def test_meter_message_from_counter_signed(): assert 'message_signature' in msg -def test_meter_message_from_counter_event_type(): - msg = meter.meter_message_from_counter(TEST_COUNTER) - assert msg['event_type'] == 'metering.' + TEST_COUNTER.type - - def test_meter_message_from_counter_field(): def compare(f, c, msg_f, msg): assert msg == c