From acfcb911869adf3d4b6b5995cc9f2d29083308eb Mon Sep 17 00:00:00 2001 From: liu-sheng Date: Thu, 30 Oct 2014 23:14:59 +0800 Subject: [PATCH] Add per device rate metrics for instances This change add pipline configuration support to gether per device rate metrics for instance. The per device rate metrics for instances is transform from the metrics of per devices for instances by adding metrics to disk_pipline in pipline cfg. These metrics will be independent of the support of per devices rate metrics provided by inspector. This thange will add the following metrics: - "disk.device.read.bytes.rate" - "disk.device.read.requests.rate" - "disk.device.write.bytes.rate" - "disk.device.write.requests.rate" Change-Id: I908ab40cc77966238944060e33603c5f4c440634 --- ceilometer/tests/test_decoupled_pipeline.py | 14 ++++++++++++++ ceilometer/tests/test_deprecated_pipeline.py | 14 ++++++++++++++ etc/ceilometer/deprecated_pipeline.yaml | 8 ++++++-- etc/ceilometer/pipeline.yaml | 8 ++++++-- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/ceilometer/tests/test_decoupled_pipeline.py b/ceilometer/tests/test_decoupled_pipeline.py index 02e44e895..4b7ac7629 100644 --- a/ceilometer/tests/test_decoupled_pipeline.py +++ b/ceilometer/tests/test_decoupled_pipeline.py @@ -240,6 +240,20 @@ class TestDecoupledPipeline(pipeline_base.BasePipelineTestCase): meters, units) + def test_rate_of_change_boilerplate_per_disk_device_read_cfg(self): + meters = ('disk.device.read.bytes', 'disk.device.read.requests') + units = ('B', 'request') + self._do_test_rate_of_change_in_boilerplate_pipeline_cfg(2, + meters, + units) + + def test_rate_of_change_boilerplate_per_disk_device_write_cfg(self): + meters = ('disk.device.write.bytes', 'disk.device.write.requests') + units = ('B', 'request') + self._do_test_rate_of_change_in_boilerplate_pipeline_cfg(2, + meters, + units) + def test_rate_of_change_boilerplate_network_outgoing_cfg(self): meters = ('network.outgoing.bytes', 'network.outgoing.packets') units = ('B', 'packet') diff --git a/ceilometer/tests/test_deprecated_pipeline.py b/ceilometer/tests/test_deprecated_pipeline.py index 7930e3eda..3f4d093ee 100644 --- a/ceilometer/tests/test_deprecated_pipeline.py +++ b/ceilometer/tests/test_deprecated_pipeline.py @@ -99,6 +99,20 @@ class TestDeprecatedPipeline(pipeline_base.BasePipelineTestCase): meters, units) + def test_rate_of_change_boilerplate_per_disk_device_read_cfg(self): + meters = ('disk.device.read.bytes', 'disk.device.read.requests') + units = ('B', 'request') + self._do_test_rate_of_change_in_boilerplate_pipeline_cfg(2, + meters, + units) + + def test_rate_of_change_boilerplate_per_disk_device_write_cfg(self): + meters = ('disk.device.write.bytes', 'disk.device.write.requests') + units = ('B', 'request') + self._do_test_rate_of_change_in_boilerplate_pipeline_cfg(2, + meters, + units) + def test_rate_of_change_boilerplate_network_incoming_cfg(self): meters = ('network.incoming.bytes', 'network.incoming.packets') units = ('B', 'packet') diff --git a/etc/ceilometer/deprecated_pipeline.yaml b/etc/ceilometer/deprecated_pipeline.yaml index b34f5ab52..6e4597fc2 100644 --- a/etc/ceilometer/deprecated_pipeline.yaml +++ b/etc/ceilometer/deprecated_pipeline.yaml @@ -31,16 +31,20 @@ - "disk.read.requests" - "disk.write.bytes" - "disk.write.requests" + - "disk.device.read.bytes" + - "disk.device.read.requests" + - "disk.device.write.bytes" + - "disk.device.write.requests" transformers: - name: "rate_of_change" parameters: source: map_from: - name: "disk\\.(read|write)\\.(bytes|requests)" + name: "(disk\\.device|disk)\\.(read|write)\\.(bytes|requests)" unit: "(B|request)" target: map_to: - name: "disk.\\1.\\2.rate" + name: "\\1.\\2.\\3.rate" unit: "\\1/s" type: "gauge" publishers: diff --git a/etc/ceilometer/pipeline.yaml b/etc/ceilometer/pipeline.yaml index a71ed0958..12b45f2e0 100644 --- a/etc/ceilometer/pipeline.yaml +++ b/etc/ceilometer/pipeline.yaml @@ -19,6 +19,10 @@ sources: - "disk.read.requests" - "disk.write.bytes" - "disk.write.requests" + - "disk.device.read.bytes" + - "disk.device.read.requests" + - "disk.device.write.bytes" + - "disk.device.write.requests" sinks: - disk_sink - name: network_source @@ -52,11 +56,11 @@ sinks: parameters: source: map_from: - name: "disk\\.(read|write)\\.(bytes|requests)" + name: "(disk\\.device|disk)\\.(read|write)\\.(bytes|requests)" unit: "(B|request)" target: map_to: - name: "disk.\\1.\\2.rate" + name: "\\1.\\2.\\3.rate" unit: "\\1/s" type: "gauge" publishers: