compute: remove deprecated disk meters

The equivalent disk.device meters are available for a while now.

Change-Id: I6f1af3b8d0a1ec32b2722db62ab9cafe6309532f
This commit is contained in:
Julien Danjou 2018-07-06 18:06:21 +02:00
parent 9db5c6c9bf
commit f7b1218b8e
7 changed files with 17 additions and 336 deletions

View File

@ -14,46 +14,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import collections
from oslo_log import log
from ceilometer.compute import pollsters
from ceilometer import sample
LOG = log.getLogger(__name__)
AGGREGATED_DEPRECATION_DONE = set()
class AggregateDiskPollster(pollsters.GenericComputePollster):
inspector_method = "inspect_disks"
def aggregate_method(self, result):
fields = list(result[0]._fields)
fields.remove("device")
agg_stats = collections.defaultdict(int)
devices = []
for stats in result:
devices.append(stats.device)
for f in fields:
agg_stats[f] += getattr(stats, f)
kwargs = dict(agg_stats)
kwargs["device"] = devices
return [result[0].__class__(**kwargs)]
@staticmethod
def get_additional_metadata(instance, stats):
return {'device': stats.device}
def get_samples(self, *args, **kwargs):
if self.sample_name not in AGGREGATED_DEPRECATION_DONE:
AGGREGATED_DEPRECATION_DONE.add(self.sample_name)
LOG.warning("The %s metric is deprecated, instead use %s" %
(self.sample_name,
self.sample_name.replace("disk.", "disk.device.")))
return super(AggregateDiskPollster, self).get_samples(*args, **kwargs)
class PerDeviceDiskPollster(pollsters.GenericComputePollster):
inspector_method = "inspect_disks"
@ -67,13 +30,6 @@ class PerDeviceDiskPollster(pollsters.GenericComputePollster):
return {'disk_name': stats.device}
class ReadRequestsPollster(AggregateDiskPollster):
sample_name = 'disk.read.requests'
sample_unit = 'request'
sample_type = sample.TYPE_CUMULATIVE
sample_stats_key = 'read_requests'
class PerDeviceReadRequestsPollster(PerDeviceDiskPollster):
sample_name = 'disk.device.read.requests'
sample_unit = 'request'
@ -81,13 +37,6 @@ class PerDeviceReadRequestsPollster(PerDeviceDiskPollster):
sample_stats_key = 'read_requests'
class ReadBytesPollster(AggregateDiskPollster):
sample_name = 'disk.read.bytes'
sample_unit = 'B'
sample_type = sample.TYPE_CUMULATIVE
sample_stats_key = 'read_bytes'
class PerDeviceReadBytesPollster(PerDeviceDiskPollster):
sample_name = 'disk.device.read.bytes'
sample_unit = 'B'
@ -95,13 +44,6 @@ class PerDeviceReadBytesPollster(PerDeviceDiskPollster):
sample_stats_key = 'read_bytes'
class WriteRequestsPollster(AggregateDiskPollster):
sample_name = 'disk.write.requests'
sample_unit = 'request'
sample_type = sample.TYPE_CUMULATIVE
sample_stats_key = 'write_requests'
class PerDeviceWriteRequestsPollster(PerDeviceDiskPollster):
sample_name = 'disk.device.write.requests'
sample_unit = 'request'
@ -109,13 +51,6 @@ class PerDeviceWriteRequestsPollster(PerDeviceDiskPollster):
sample_stats_key = 'write_requests'
class WriteBytesPollster(AggregateDiskPollster):
sample_name = 'disk.write.bytes'
sample_unit = 'B'
sample_type = sample.TYPE_CUMULATIVE
sample_stats_key = 'write_bytes'
class PerDeviceWriteBytesPollster(PerDeviceDiskPollster):
sample_name = 'disk.device.write.bytes'
sample_unit = 'B'
@ -123,69 +58,6 @@ class PerDeviceWriteBytesPollster(PerDeviceDiskPollster):
sample_stats_key = 'write_bytes'
class ReadBytesRatePollster(AggregateDiskPollster):
inspector_method = "inspect_disk_rates"
sample_name = 'disk.read.bytes.rate'
sample_unit = 'B/s'
sample_stats_key = 'read_bytes_rate'
class PerDeviceReadBytesRatePollster(PerDeviceDiskPollster):
inspector_method = "inspect_disk_rates"
sample_name = 'disk.device.read.bytes.rate'
sample_unit = 'B/s'
sample_stats_key = 'read_bytes_rate'
class ReadRequestsRatePollster(AggregateDiskPollster):
inspector_method = "inspect_disk_rates"
sample_name = 'disk.read.requests.rate'
sample_unit = 'request/s'
sample_stats_key = 'read_requests_rate'
class PerDeviceReadRequestsRatePollster(PerDeviceDiskPollster):
inspector_method = "inspect_disk_rates"
sample_name = 'disk.device.read.requests.rate'
sample_unit = 'request/s'
sample_stats_key = 'read_requests_rate'
class WriteBytesRatePollster(AggregateDiskPollster):
inspector_method = "inspect_disk_rates"
sample_name = 'disk.write.bytes.rate'
sample_unit = 'B/s'
sample_stats_key = 'write_bytes_rate'
class PerDeviceWriteBytesRatePollster(PerDeviceDiskPollster):
inspector_method = "inspect_disk_rates"
sample_name = 'disk.device.write.bytes.rate'
sample_unit = 'B/s'
sample_stats_key = 'write_bytes_rate'
class WriteRequestsRatePollster(AggregateDiskPollster):
inspector_method = "inspect_disk_rates"
sample_name = 'disk.write.requests.rate'
sample_unit = 'request/s'
sample_stats_key = 'write_requests_rate'
class PerDeviceWriteRequestsRatePollster(PerDeviceDiskPollster):
inspector_method = "inspect_disk_rates"
sample_name = 'disk.device.write.requests.rate'
sample_unit = 'request/s'
sample_stats_key = 'write_requests_rate'
class DiskLatencyPollster(AggregateDiskPollster):
inspector_method = 'inspect_disk_latency'
sample_name = 'disk.latency'
sample_unit = 'ms'
sample_stats_key = 'disk_latency'
class PerDeviceDiskLatencyPollster(PerDeviceDiskPollster):
inspector_method = 'inspect_disk_latency'
sample_name = 'disk.device.latency'
@ -193,13 +65,6 @@ class PerDeviceDiskLatencyPollster(PerDeviceDiskPollster):
sample_stats_key = 'disk_latency'
class DiskIOPSPollster(AggregateDiskPollster):
inspector_method = 'inspect_disk_iops'
sample_name = 'disk.iops'
sample_unit = 'count/s'
sample_stats_key = 'iops_count'
class PerDeviceDiskIOPSPollster(PerDeviceDiskPollster):
inspector_method = 'inspect_disk_iops'
sample_name = 'disk.device.iops'
@ -207,13 +72,6 @@ class PerDeviceDiskIOPSPollster(PerDeviceDiskPollster):
sample_stats_key = 'iops_count'
class CapacityPollster(AggregateDiskPollster):
inspector_method = 'inspect_disk_info'
sample_name = 'disk.capacity'
sample_unit = 'B'
sample_stats_key = 'capacity'
class PerDeviceCapacityPollster(PerDeviceDiskPollster):
inspector_method = 'inspect_disk_info'
sample_name = 'disk.device.capacity'
@ -221,13 +79,6 @@ class PerDeviceCapacityPollster(PerDeviceDiskPollster):
sample_stats_key = 'capacity'
class AllocationPollster(AggregateDiskPollster):
inspector_method = 'inspect_disk_info'
sample_name = 'disk.allocation'
sample_unit = 'B'
sample_stats_key = 'allocation'
class PerDeviceAllocationPollster(PerDeviceDiskPollster):
inspector_method = 'inspect_disk_info'
sample_name = 'disk.device.allocation'
@ -235,13 +86,6 @@ class PerDeviceAllocationPollster(PerDeviceDiskPollster):
sample_stats_key = 'allocation'
class PhysicalPollster(AggregateDiskPollster):
inspector_method = 'inspect_disk_info'
sample_name = 'disk.usage'
sample_unit = 'B'
sample_stats_key = 'physical'
class PerDevicePhysicalPollster(PerDeviceDiskPollster):
inspector_method = 'inspect_disk_info'
sample_name = 'disk.device.usage'

View File

@ -89,18 +89,6 @@ resources:
cpu_l3_cache:
disk.root.size:
disk.ephemeral.size:
disk.read.requests:
archive_policy_name: ceilometer-low-rate
disk.read.requests.rate:
disk.write.requests:
archive_policy_name: ceilometer-low-rate
disk.write.requests.rate:
disk.read.bytes:
archive_policy_name: ceilometer-low-rate
disk.read.bytes.rate:
disk.write.bytes:
archive_policy_name: ceilometer-low-rate
disk.write.bytes.rate:
disk.latency:
disk.iops:
disk.capacity:

View File

@ -113,26 +113,6 @@ class TestDiskPollsters(TestBaseDiskIO):
super(TestDiskPollsters, self).setUp()
self.inspector.inspect_disks = mock.Mock(return_value=self.DISKS)
def test_disk_read_requests(self):
self._check_aggregate_samples(disk.ReadRequestsPollster,
'disk.read.requests', 5,
expected_device=['vda1', 'vda2'])
def test_disk_read_bytes(self):
self._check_aggregate_samples(disk.ReadBytesPollster,
'disk.read.bytes', 3,
expected_device=['vda1', 'vda2'])
def test_disk_write_requests(self):
self._check_aggregate_samples(disk.WriteRequestsPollster,
'disk.write.requests', 11,
expected_device=['vda1', 'vda2'])
def test_disk_write_bytes(self):
self._check_aggregate_samples(disk.WriteBytesPollster,
'disk.write.bytes', 8,
expected_device=['vda1', 'vda2'])
def test_per_disk_read_requests(self):
self._check_per_device_samples(disk.PerDeviceReadRequestsPollster,
'disk.device.read.requests', 2,
@ -184,71 +164,6 @@ class TestDiskPollsters(TestBaseDiskIO):
'disk.device.write.latency', 400, 'vda2')
class TestDiskRatePollsters(TestBaseDiskIO):
DISKS = [
virt_inspector.DiskRateStats("disk1", 1024, 300, 5120, 700),
virt_inspector.DiskRateStats("disk2", 2048, 400, 6144, 800)
]
TYPE = 'gauge'
def setUp(self):
super(TestDiskRatePollsters, self).setUp()
self.inspector.inspect_disk_rates = mock.Mock(return_value=self.DISKS)
def test_disk_read_bytes_rate(self):
self._check_aggregate_samples(disk.ReadBytesRatePollster,
'disk.read.bytes.rate', 3072,
expected_device=['disk1', 'disk2'])
def test_disk_read_requests_rate(self):
self._check_aggregate_samples(disk.ReadRequestsRatePollster,
'disk.read.requests.rate', 700,
expected_device=['disk1', 'disk2'])
def test_disk_write_bytes_rate(self):
self._check_aggregate_samples(disk.WriteBytesRatePollster,
'disk.write.bytes.rate', 11264,
expected_device=['disk1', 'disk2'])
def test_disk_write_requests_rate(self):
self._check_aggregate_samples(disk.WriteRequestsRatePollster,
'disk.write.requests.rate', 1500,
expected_device=['disk1', 'disk2'])
def test_per_disk_read_bytes_rate(self):
self._check_per_device_samples(disk.PerDeviceReadBytesRatePollster,
'disk.device.read.bytes.rate',
1024, 'disk1')
self._check_per_device_samples(disk.PerDeviceReadBytesRatePollster,
'disk.device.read.bytes.rate',
2048, 'disk2')
def test_per_disk_read_requests_rate(self):
self._check_per_device_samples(disk.PerDeviceReadRequestsRatePollster,
'disk.device.read.requests.rate',
300, 'disk1')
self._check_per_device_samples(disk.PerDeviceReadRequestsRatePollster,
'disk.device.read.requests.rate',
400, 'disk2')
def test_per_disk_write_bytes_rate(self):
self._check_per_device_samples(disk.PerDeviceWriteBytesRatePollster,
'disk.device.write.bytes.rate',
5120, 'disk1')
self._check_per_device_samples(disk.PerDeviceWriteBytesRatePollster,
'disk.device.write.bytes.rate', 6144,
'disk2')
def test_per_disk_write_requests_rate(self):
self._check_per_device_samples(disk.PerDeviceWriteRequestsRatePollster,
'disk.device.write.requests.rate', 700,
'disk1')
self._check_per_device_samples(disk.PerDeviceWriteRequestsRatePollster,
'disk.device.write.requests.rate', 800,
'disk2')
class TestDiskLatencyPollsters(TestBaseDiskIO):
DISKS = [
@ -262,10 +177,6 @@ class TestDiskLatencyPollsters(TestBaseDiskIO):
self.inspector.inspect_disk_latency = mock.Mock(
return_value=self.DISKS)
def test_disk_latency(self):
self._check_aggregate_samples(disk.DiskLatencyPollster,
'disk.latency', 3)
def test_per_device_latency(self):
self._check_per_device_samples(disk.PerDeviceDiskLatencyPollster,
'disk.device.latency', 1, 'disk1')
@ -286,10 +197,6 @@ class TestDiskIOPSPollsters(TestBaseDiskIO):
super(TestDiskIOPSPollsters, self).setUp()
self.inspector.inspect_disk_iops = mock.Mock(return_value=self.DISKS)
def test_disk_iops(self):
self._check_aggregate_samples(disk.DiskIOPSPollster,
'disk.iops', 30)
def test_per_device_iops(self):
self._check_per_device_samples(disk.PerDeviceDiskIOPSPollster,
'disk.device.iops', 10, 'disk1')
@ -312,21 +219,6 @@ class TestDiskInfoPollsters(TestBaseDiskIO):
super(TestDiskInfoPollsters, self).setUp()
self.inspector.inspect_disk_info = mock.Mock(return_value=self.DISKS)
def test_disk_capacity(self):
self._check_aggregate_samples(disk.CapacityPollster,
'disk.capacity', 7,
expected_device=['vda1', 'vda2'])
def test_disk_allocation(self):
self._check_aggregate_samples(disk.AllocationPollster,
'disk.allocation', 5,
expected_device=['vda1', 'vda2'])
def test_disk_physical(self):
self._check_aggregate_samples(disk.PhysicalPollster,
'disk.usage', 3,
expected_device=['vda1', 'vda2'])
def test_per_disk_capacity(self):
self._check_per_device_samples(disk.PerDeviceCapacityPollster,
'disk.device.capacity', 3,

View File

@ -107,28 +107,6 @@ The following meters are collected for OpenStack Compute.
| | | | ID | ation | Hyper-V | CPUs allocated to|
| | | | | | | the instance |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.read\| Cumul\| req\ | instance | Pollster | Libvirt,| Number of read |
| .requests | ative | uest | ID | | Hyper-V | requests |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.writ\| Cumul\| req\ | instance | Pollster | Libvirt,| Number of write |
| e.requests| ative | uest | ID | | Hyper-V | requests |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.read\| Cumu\ | B | instance | Pollster | Libvirt,| Volume of reads |
| .bytes | lative| | ID | | Hyper-V | |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.read\| Gauge | B/s | instance | Pollster | Libvirt,| Average rate of |
| .bytes.\ | | | ID | | Hyper-V,| reads |
| rate | | | | | vSphere,| |
| | | | | | XenAPI | |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.writ\| Cumu\ | B | instance | Pollster | Libvirt,| Volume of writes |
| e.bytes | lative| | ID | | Hyper-V | |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.writ\| Gauge | B/s | instance | Pollster | Libvirt,| Average rate of |
| e.bytes.\ | | | ID | | Hyper-V,| writes |
| rate | | | | | vSphere,| |
| | | | | | XenAPI | |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.dev\ | Cumu\ | req\ | disk ID | Pollster | Libvirt,| Number of read |
| ice.read\ | lative| uest | | | Hyper-V | requests |
| .requests | | | | | | |
@ -151,12 +129,6 @@ The following meters are collected for OpenStack Compute.
| disk.ephe\| Gauge | GB | instance | Notific\ | Libvirt,| Size of ephemeral|
| meral.size| | | ID | ation | Hyper-V | disk |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.lat\ | Gauge | ms | instance | Pollster | Hyper-V | Average disk la\ |
| ency | | | ID | | | tency |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.iop\ | Gauge | coun\| instance | Pollster | Hyper-V | Average disk io\ |
| s | | t/s | ID | | | ps |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.dev\ | Gauge | ms | disk ID | Pollster | Hyper-V | Average disk la\ |
| ice.late\ | | | | | | tency per device |
| ncy | | | | | | |
@ -164,21 +136,6 @@ The following meters are collected for OpenStack Compute.
| disk.dev\ | Gauge | coun\| disk ID | Pollster | Hyper-V | Average disk io\ |
| ice.iops | | t/s | | | | ps per device |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.cap\ | Gauge | B | instance | Pollster | Libvirt | The amount of d\ |
| acity | | | ID | | | isk that the in\ |
| | | | | | | stance can see |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.all\ | Gauge | B | instance | Pollster | Libvirt | The amount of d\ |
| ocation | | | ID | | | isk occupied by |
| | | | | | | the instance o\ |
| | | | | | | n the host mach\ |
| | | | | | | ine |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.usa\ | Gauge | B | instance | Pollster | Libvirt | The physical si\ |
| ge | | | ID | | | ze in bytes of |
| | | | | | | the image conta\ |
| | | | | | | iner on the host |
+-----------+-------+------+----------+----------+---------+------------------+
| disk.dev\ | Gauge | B | disk ID | Pollster | Libvirt | The amount of d\ |
| ice.capa\ | | | | | | isk per device |
| city | | | | | | that the instan\ |

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The deprecated `disk.*` meters have been removed. Use the `disk.device.*`
meters instead.

View File

@ -0,0 +1,12 @@
---
upgrade:
- |
The deprecated meter for compute where removed:
- disk.read.requests.rate
- disk.write.requests.rate
- disk.read.bytes.rate
- disk.write.bytes.rate
- disk.device.read.requests.rate
- disk.device.write.requests.rate
- disk.device.read.bytes.rate
- disk.device.write.bytes.rate

View File

@ -79,27 +79,13 @@ ceilometer.discover.ipmi =
local_node = ceilometer.polling.discovery.localnode:LocalNodeDiscovery
ceilometer.poll.compute =
disk.read.requests = ceilometer.compute.pollsters.disk:ReadRequestsPollster
disk.write.requests = ceilometer.compute.pollsters.disk:WriteRequestsPollster
disk.read.bytes = ceilometer.compute.pollsters.disk:ReadBytesPollster
disk.write.bytes = ceilometer.compute.pollsters.disk:WriteBytesPollster
disk.read.requests.rate = ceilometer.compute.pollsters.disk:ReadRequestsRatePollster
disk.write.requests.rate = ceilometer.compute.pollsters.disk:WriteRequestsRatePollster
disk.read.bytes.rate = ceilometer.compute.pollsters.disk:ReadBytesRatePollster
disk.write.bytes.rate = ceilometer.compute.pollsters.disk:WriteBytesRatePollster
disk.device.read.requests = ceilometer.compute.pollsters.disk:PerDeviceReadRequestsPollster
disk.device.write.requests = ceilometer.compute.pollsters.disk:PerDeviceWriteRequestsPollster
disk.device.read.bytes = ceilometer.compute.pollsters.disk:PerDeviceReadBytesPollster
disk.device.write.bytes = ceilometer.compute.pollsters.disk:PerDeviceWriteBytesPollster
disk.device.read.requests.rate = ceilometer.compute.pollsters.disk:PerDeviceReadRequestsRatePollster
disk.device.write.requests.rate = ceilometer.compute.pollsters.disk:PerDeviceWriteRequestsRatePollster
disk.device.read.bytes.rate = ceilometer.compute.pollsters.disk:PerDeviceReadBytesRatePollster
disk.device.write.bytes.rate = ceilometer.compute.pollsters.disk:PerDeviceWriteBytesRatePollster
disk.device.read.latency = ceilometer.compute.pollsters.disk:PerDeviceDiskReadLatencyPollster
disk.device.write.latency = ceilometer.compute.pollsters.disk:PerDeviceDiskWriteLatencyPollster
disk.latency = ceilometer.compute.pollsters.disk:DiskLatencyPollster
disk.device.latency = ceilometer.compute.pollsters.disk:PerDeviceDiskLatencyPollster
disk.iops = ceilometer.compute.pollsters.disk:DiskIOPSPollster
disk.device.iops = ceilometer.compute.pollsters.disk:PerDeviceDiskIOPSPollster
cpu = ceilometer.compute.pollsters.instance_stats:CPUPollster
cpu_util = ceilometer.compute.pollsters.instance_stats:CPUUtilPollster
@ -120,9 +106,6 @@ ceilometer.poll.compute =
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.capacity = ceilometer.compute.pollsters.disk:CapacityPollster
disk.allocation = ceilometer.compute.pollsters.disk:AllocationPollster
disk.usage = ceilometer.compute.pollsters.disk:PhysicalPollster
disk.device.capacity = ceilometer.compute.pollsters.disk:PerDeviceCapacityPollster
disk.device.allocation = ceilometer.compute.pollsters.disk:PerDeviceAllocationPollster
disk.device.usage = ceilometer.compute.pollsters.disk:PerDevicePhysicalPollster