From 9fe1d19de22de0dcecf2bfed086b75a3a8a706a0 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 24 Dec 2024 01:49:11 +0900 Subject: [PATCH] Remove metrics dependent on Intel CMT perf events Support for Intel CMT perf events was already removed from nova[1], because the implementation was removed from kernel some years ago[2]. These metrics have been broken for some time, so remove these metrics directly. [1] e45f3b5d71342d179bc150901f2dd5dabef238ca [2] fc4794acc6b13afade1bb72a1ae9f574707d2f0d Change-Id: Ia1996692347a3a3e8d4ff057996d5eb6840ca3de --- .../compute/pollsters/instance_stats.py | 18 -------- ceilometer/compute/virt/inspector.py | 29 ++++++------- ceilometer/compute/virt/libvirt/inspector.py | 5 +-- .../publisher/data/gnocchi_resources.yaml | 3 -- .../tests/unit/compute/pollsters/test_cpu.py | 23 ---------- .../unit/compute/pollsters/test_memory.py | 42 ------------------- .../compute/virt/libvirt/test_inspector.py | 11 +---- doc/source/admin/telemetry-measurements.rst | 12 ------ etc/ceilometer/polling.yaml | 1 - ...ntel-cmt-perf-meters-15d0fe72b2804f48.yaml | 10 +++++ setup.cfg | 3 -- 11 files changed, 24 insertions(+), 133 deletions(-) create mode 100644 releasenotes/notes/remove-intel-cmt-perf-meters-15d0fe72b2804f48.yaml diff --git a/ceilometer/compute/pollsters/instance_stats.py b/ceilometer/compute/pollsters/instance_stats.py index eb4874d299..14d390403f 100644 --- a/ceilometer/compute/pollsters/instance_stats.py +++ b/ceilometer/compute/pollsters/instance_stats.py @@ -82,21 +82,3 @@ class PerfCacheReferencesPollster(InstanceStatsPollster): class PerfCacheMissesPollster(InstanceStatsPollster): sample_name = 'perf.cache.misses' sample_stats_key = 'cache_misses' - - -class MemoryBandwidthTotalPollster(InstanceStatsPollster): - sample_name = 'memory.bandwidth.total' - sample_unit = 'B/s' - sample_stats_key = 'memory_bandwidth_total' - - -class MemoryBandwidthLocalPollster(InstanceStatsPollster): - sample_name = 'memory.bandwidth.local' - sample_unit = 'B/s' - sample_stats_key = 'memory_bandwidth_local' - - -class CPUL3CachePollster(InstanceStatsPollster): - sample_name = 'cpu_l3_cache' - sample_unit = 'B' - sample_stats_key = "cpu_l3_cache_usage" diff --git a/ceilometer/compute/virt/inspector.py b/ceilometer/compute/virt/inspector.py index 994f68e754..2085528b3b 100644 --- a/ceilometer/compute/virt/inspector.py +++ b/ceilometer/compute/virt/inspector.py @@ -40,23 +40,18 @@ LOG = log.getLogger(__name__) class InstanceStats(object): fields = [ - 'power_state', # the power state of the domain - 'cpu_number', # number: number of CPUs - 'cpu_time', # time: cumulative CPU time - 'cpu_l3_cache_usage', # cachesize: Amount of CPU L3 cache used - 'memory_usage', # usage: Amount of memory used - 'memory_resident', # - 'memory_swap_in', # memory swap in - 'memory_swap_out', # memory swap out - 'memory_bandwidth_total', # total: total system bandwidth from one - # level of cache - 'memory_bandwidth_local', # local: bandwidth of memory traffic for a - # memory controller - 'cpu_cycles', # cpu_cycles: the number of cpu cycles one - # instruction needs - 'instructions', # instructions: the count of instructions - 'cache_references', # cache_references: the count of cache hits - 'cache_misses', # cache_misses: the count of caches misses + 'power_state', # the power state of the domain + 'cpu_number', # number: number of CPUs + 'cpu_time', # time: cumulative CPU time + 'memory_usage', # usage: Amount of memory used + 'memory_resident', # + 'memory_swap_in', # memory swap in + 'memory_swap_out', # memory swap out + 'cpu_cycles', # cpu_cycles: the number of cpu cycles one + # instruction needs + 'instructions', # instructions: the count of instructions + 'cache_references', # cache_references: the count of cache hits + 'cache_misses', # cache_misses: the count of caches misses ] def __init__(self, **kwargs): diff --git a/ceilometer/compute/virt/libvirt/inspector.py b/ceilometer/compute/virt/libvirt/inspector.py index 29290837d0..f5001e35c5 100644 --- a/ceilometer/compute/virt/libvirt/inspector.py +++ b/ceilometer/compute/virt/libvirt/inspector.py @@ -252,8 +252,5 @@ class LibvirtInspector(virt_inspector.Inspector): cpu_cycles=stats.get("perf.cpu_cycles"), instructions=stats.get("perf.instructions"), cache_references=stats.get("perf.cache_references"), - cache_misses=stats.get("perf.cache_misses"), - memory_bandwidth_total=stats.get("perf.mbmt"), - memory_bandwidth_local=stats.get("perf.mbml"), - cpu_l3_cache_usage=stats.get("perf.cmt"), + cache_misses=stats.get("perf.cache_misses") ) diff --git a/ceilometer/publisher/data/gnocchi_resources.yaml b/ceilometer/publisher/data/gnocchi_resources.yaml index 18eb855ec8..72f3baa860 100644 --- a/ceilometer/publisher/data/gnocchi_resources.yaml +++ b/ceilometer/publisher/data/gnocchi_resources.yaml @@ -81,13 +81,10 @@ resources: memory.resident: memory.swap.in: memory.swap.out: - memory.bandwidth.total: - memory.bandwidth.local: vcpus: power.state: cpu: archive_policy_name: ceilometer-low-rate - cpu_l3_cache: disk.root.size: disk.ephemeral.size: disk.latency: diff --git a/ceilometer/tests/unit/compute/pollsters/test_cpu.py b/ceilometer/tests/unit/compute/pollsters/test_cpu.py index 4e1b6e78e3..12573e3234 100644 --- a/ceilometer/tests/unit/compute/pollsters/test_cpu.py +++ b/ceilometer/tests/unit/compute/pollsters/test_cpu.py @@ -96,26 +96,3 @@ class TestCPUPollster(base.TestPollsterBase): self.assertEqual(1, len(samples)) self.assertEqual('m1.small', samples[0].resource_metadata['instance_type']) - - -class TestCPUL3CachePollster(base.TestPollsterBase): - - def test_get_samples(self): - self._mock_inspect_instance( - virt_inspector.InstanceStats(cpu_l3_cache_usage=90112), - virt_inspector.InstanceStats(cpu_l3_cache_usage=180224), - ) - - mgr = manager.AgentManager(0, self.CONF) - pollster = instance_stats.CPUL3CachePollster(self.CONF) - - def _verify_cpu_l3_cache_metering(expected_usage): - cache = {} - samples = list(pollster.get_samples(mgr, cache, [self.instance])) - self.assertEqual(1, len(samples)) - self.assertEqual(set(['cpu_l3_cache']), - set([s.name for s in samples])) - self.assertEqual(expected_usage, samples[0].volume) - - _verify_cpu_l3_cache_metering(90112) - _verify_cpu_l3_cache_metering(180224) diff --git a/ceilometer/tests/unit/compute/pollsters/test_memory.py b/ceilometer/tests/unit/compute/pollsters/test_memory.py index ddcd29a139..e5b50207fc 100644 --- a/ceilometer/tests/unit/compute/pollsters/test_memory.py +++ b/ceilometer/tests/unit/compute/pollsters/test_memory.py @@ -136,45 +136,3 @@ class TestMemorySwapPollster(base.TestPollsterBase): def all_samples(): return list(pollster.get_samples(mgr, {}, [self.instance])) - - -class TestMemoryBandwidthPollster(base.TestPollsterBase): - - def test_get_samples(self): - self._mock_inspect_instance( - virt_inspector.InstanceStats(memory_bandwidth_total=1892352, - memory_bandwidth_local=1802240), - virt_inspector.InstanceStats(memory_bandwidth_total=1081344, - memory_bandwidth_local=90112), - ) - - mgr = manager.AgentManager(0, self.CONF) - - def _check_memory_bandwidth_total(expected_usage): - pollster = instance_stats.MemoryBandwidthTotalPollster(self.CONF) - - samples = list(pollster.get_samples(mgr, {}, [self.instance])) - self.assertEqual(1, len(samples)) - self.assertEqual(set(['memory.bandwidth.total']), - set([s.name for s in samples])) - self.assertEqual(expected_usage, samples[0].volume) - - def _check_memory_bandwidth_local(expected_usage): - pollster = instance_stats.MemoryBandwidthLocalPollster(self.CONF) - - samples = list(pollster.get_samples(mgr, {}, [self.instance])) - self.assertEqual(1, len(samples)) - self.assertEqual(set(['memory.bandwidth.local']), - set([s.name for s in samples])) - self.assertEqual(expected_usage, samples[0].volume) - - _check_memory_bandwidth_total(1892352) - _check_memory_bandwidth_local(90112) - - def test_get_samples_with_empty_stats(self): - self._mock_inspect_instance(virt_inspector.NoDataException()) - mgr = manager.AgentManager(0, self.CONF) - pollster = instance_stats.MemoryBandwidthTotalPollster(self.CONF) - - def all_samples(): - return list(pollster.get_samples(mgr, {}, [self.instance])) diff --git a/ceilometer/tests/unit/compute/virt/libvirt/test_inspector.py b/ceilometer/tests/unit/compute/virt/libvirt/test_inspector.py index 3a1d5faf70..446e24e0d9 100644 --- a/ceilometer/tests/unit/compute/virt/libvirt/test_inspector.py +++ b/ceilometer/tests/unit/compute/virt/libvirt/test_inspector.py @@ -67,13 +67,10 @@ class TestLibvirtInspection(base.BaseTestCase): 'vcpu.0.wait': 10000, 'vcpu.2.time': 10000, 'vcpu.2.wait': 10000, - 'perf.cmt': 90112, 'perf.cpu_cycles': 7259361, 'perf.instructions': 8815623, 'perf.cache_references': 74184, - 'perf.cache_misses': 16737, - 'perf.mbmt': 1892352, - 'perf.mbml': 1802240})] + 'perf.cache_misses': 16737})] with mock.patch('ceilometer.compute.virt.libvirt.utils.' 'refresh_libvirt_connection', return_value=conn): @@ -81,13 +78,10 @@ class TestLibvirtInspection(base.BaseTestCase): self.assertEqual(0, stats.power_state) self.assertEqual(2, stats.cpu_number) self.assertEqual(40000, stats.cpu_time) - self.assertEqual(90112, stats.cpu_l3_cache_usage) self.assertEqual(25600 / units.Ki, stats.memory_usage) self.assertEqual(30000 / units.Ki, stats.memory_resident) self.assertEqual(5120 / units.Ki, stats.memory_swap_in) self.assertEqual(8192 / units.Ki, stats.memory_swap_out) - self.assertEqual(1892352, stats.memory_bandwidth_total) - self.assertEqual(1802240, stats.memory_bandwidth_local) self.assertEqual(7259361, stats.cpu_cycles) self.assertEqual(8815623, stats.instructions) self.assertEqual(74184, stats.cache_references) @@ -510,9 +504,6 @@ class TestLibvirtInspection(base.BaseTestCase): with mock.patch('ceilometer.compute.virt.libvirt.utils.' 'refresh_libvirt_connection', return_value=conn): stats = self.inspector.inspect_instance(self.instance, None) - self.assertIsNone(stats.cpu_l3_cache_usage) - self.assertIsNone(stats.memory_bandwidth_total) - self.assertIsNone(stats.memory_bandwidth_local) self.assertIsNone(stats.cpu_cycles) self.assertIsNone(stats.instructions) self.assertIsNone(stats.cache_references) diff --git a/doc/source/admin/telemetry-measurements.rst b/doc/source/admin/telemetry-measurements.rst index 53cd923767..661cf1fe1d 100644 --- a/doc/source/admin/telemetry-measurements.rst +++ b/doc/source/admin/telemetry-measurements.rst @@ -164,18 +164,6 @@ The following meters are collected for OpenStack Compute. +-----------+-------+------+----------+----------+---------+------------------+ | **Meters added in the Newton release** | +-----------+-------+------+----------+----------+---------+------------------+ -| cpu_l3_c\ | Gauge | B | instance | Pollster | Libvirt | L3 cache used b\ | -| ache | | | ID | | | y the instance | -+-----------+-------+------+----------+----------+---------+------------------+ -| memory.b\ | Gauge | B/s | instance | Pollster | Libvirt | Total system ba\ | -| andwidth\ | | | ID | | | ndwidth from on\ | -| .total | | | | | | e level of cache | -+-----------+-------+------+----------+----------+---------+------------------+ -| memory.b\ | Gauge | B/s | instance | Pollster | Libvirt | Bandwidth of me\ | -| andwidth\ | | | ID | | | mory traffic fo\ | -| .local | | | | | | r a memory cont\ | -| | | | | | | roller | -+-----------+-------+------+----------+----------+---------+------------------+ | perf.cpu\ | Gauge | cyc\ | instance | Pollster | Libvirt | the number of c\ | | .cycles | | le | ID | | | pu cycles one i\ | | | | | | | | nstruction needs | diff --git a/etc/ceilometer/polling.yaml b/etc/ceilometer/polling.yaml index 4845f0efa7..61af44134e 100644 --- a/etc/ceilometer/polling.yaml +++ b/etc/ceilometer/polling.yaml @@ -5,7 +5,6 @@ sources: meters: - power.state - cpu - - cpu_l3_cache - memory.usage - network.incoming.bytes - network.incoming.packets diff --git a/releasenotes/notes/remove-intel-cmt-perf-meters-15d0fe72b2804f48.yaml b/releasenotes/notes/remove-intel-cmt-perf-meters-15d0fe72b2804f48.yaml new file mode 100644 index 0000000000..1ec976b5eb --- /dev/null +++ b/releasenotes/notes/remove-intel-cmt-perf-meters-15d0fe72b2804f48.yaml @@ -0,0 +1,10 @@ +--- +upgrade: + - | + The following meters were removed. Nova removed support for Intel CMT + perf events in 22.0.0, and these meters can no longer be measured since + then. + + - ``cpu_l3_cache_usage`` + - ``memory_bandwidth_local`` + - ``memory_bandwidth_total`` diff --git a/setup.cfg b/setup.cfg index 6b5ed65535..1f84d13c65 100644 --- a/setup.cfg +++ b/setup.cfg @@ -75,7 +75,6 @@ ceilometer.poll.compute = disk.device.write.latency = ceilometer.compute.pollsters.disk:PerDeviceDiskWriteLatencyPollster power.state = ceilometer.compute.pollsters.instance_stats:PowerStatePollster cpu = ceilometer.compute.pollsters.instance_stats:CPUPollster - cpu_l3_cache = ceilometer.compute.pollsters.instance_stats:CPUL3CachePollster network.incoming.bytes = ceilometer.compute.pollsters.net:IncomingBytesPollster network.incoming.packets = ceilometer.compute.pollsters.net:IncomingPacketsPollster network.outgoing.bytes = ceilometer.compute.pollsters.net:OutgoingBytesPollster @@ -92,8 +91,6 @@ ceilometer.poll.compute = memory.resident = ceilometer.compute.pollsters.instance_stats:MemoryResidentPollster memory.swap.in = ceilometer.compute.pollsters.instance_stats:MemorySwapInPollster memory.swap.out = ceilometer.compute.pollsters.instance_stats:MemorySwapOutPollster - memory.bandwidth.total = ceilometer.compute.pollsters.instance_stats:MemoryBandwidthTotalPollster - memory.bandwidth.local = ceilometer.compute.pollsters.instance_stats:MemoryBandwidthLocalPollster disk.device.capacity = ceilometer.compute.pollsters.disk:PerDeviceCapacityPollster disk.device.allocation = ceilometer.compute.pollsters.disk:PerDeviceAllocationPollster disk.device.usage = ceilometer.compute.pollsters.disk:PerDevicePhysicalPollster