From cb5e05dd10739e96d0c513ad3d760b4bc009bee8 Mon Sep 17 00:00:00 2001 From: Nicolas Ruflin Date: Fri, 18 Aug 2017 13:54:27 +0200 Subject: [PATCH] Cleanup iostats field naming (#4900) * Cleanup iostats field naming Align naming with other metricsets. --- metricbeat/docs/fields.asciidoc | 20 ++++++---- .../module/system/diskio/_meta/fields.yml | 18 +++++---- metricbeat/module/system/diskio/diskio.go | 38 +++++++++++++------ metricbeat/tests/system/test_system.py | 4 +- 4 files changed, 51 insertions(+), 29 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index cf12c65ebbc6..8258d3dddd3c 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -8773,7 +8773,7 @@ The total number of of milliseconds spent doing I/Os. [float] -=== `system.diskio.iostat.read_request_merged_per_sec` +=== `system.diskio.iostat.read.request.merges_per_sec` type: float @@ -8781,7 +8781,7 @@ The number of read requests merged per second that were queued to the device. [float] -=== `system.diskio.iostat.write_request_merged_per_sec` +=== `system.diskio.iostat.write.request.merges_per_sec` type: float @@ -8789,7 +8789,7 @@ The number of write requests merged per second that were queued to the device. [float] -=== `system.diskio.iostat.read_request_per_sec` +=== `system.diskio.iostat.read.request.per_sec` type: float @@ -8797,7 +8797,7 @@ The number of read requests that were issued to the device per second [float] -=== `system.diskio.iostat.write_request_per_sec` +=== `system.diskio.iostat.write.request.per_sec` type: float @@ -8805,23 +8805,27 @@ The number of write requests that were issued to the device per second [float] -=== `system.diskio.iostat.read_byte_per_sec` +=== `system.diskio.iostat.read.per_sec.bytes` type: float +format: bytes + The number of Bytes read from the device per second. [float] -=== `system.diskio.iostat.write_byte_per_sec` +=== `system.diskio.iostat.write.per_sec.bytes` type: float +format: bytes + The number of Bytes write from the device per second. [float] -=== `system.diskio.iostat.avg_request_size` +=== `system.diskio.iostat.request.avg_size` type: float @@ -8829,7 +8833,7 @@ The average size (in sectors) of the requests that were issued to the device. [float] -=== `system.diskio.iostat.avg_queue_size` +=== `system.diskio.iostat.queue.avg_size` type: float diff --git a/metricbeat/module/system/diskio/_meta/fields.yml b/metricbeat/module/system/diskio/_meta/fields.yml index 57f346965059..fa098d82e323 100644 --- a/metricbeat/module/system/diskio/_meta/fields.yml +++ b/metricbeat/module/system/diskio/_meta/fields.yml @@ -55,42 +55,44 @@ description: > The total number of of milliseconds spent doing I/Os. - - name: iostat.read_request_merged_per_sec + - name: iostat.read.request.merges_per_sec type: float description: > The number of read requests merged per second that were queued to the device. - - name: iostat.write_request_merged_per_sec + - name: iostat.write.request.merges_per_sec type: float description: > The number of write requests merged per second that were queued to the device. - - name: iostat.read_request_per_sec + - name: iostat.read.request.per_sec type: float description: > The number of read requests that were issued to the device per second - - name: iostat.write_request_per_sec + - name: iostat.write.request.per_sec type: float description: > The number of write requests that were issued to the device per second - - name: iostat.read_byte_per_sec + - name: iostat.read.per_sec.bytes type: float description: > The number of Bytes read from the device per second. + format: bytes - - name: iostat.write_byte_per_sec + - name: iostat.write.per_sec.bytes type: float description: > The number of Bytes write from the device per second. + format: bytes - - name: iostat.avg_request_size + - name: iostat.request.avg_size type: float description: > The average size (in sectors) of the requests that were issued to the device. - - name: iostat.avg_queue_size + - name: iostat.queue.avg_size type: float description: > The average queue length of the requests that were issued to the device. diff --git a/metricbeat/module/system/diskio/diskio.go b/metricbeat/module/system/diskio/diskio.go index 765a9ae4f8b6..a0a8444dc8c9 100644 --- a/metricbeat/module/system/diskio/diskio.go +++ b/metricbeat/module/system/diskio/diskio.go @@ -65,17 +65,33 @@ func (m *MetricSet) Fetch() ([]common.MapStr, error) { extraMetrics, err := m.statistics.CalIOStatistics(counters) if err == nil { event["iostat"] = common.MapStr{ - "read_request_merged_per_sec": extraMetrics.ReadRequestMergeCountPerSec, - "write_request_merged_per_sec": extraMetrics.WriteRequestMergeCountPerSec, - "read_request_per_sec": extraMetrics.ReadRequestCountPerSec, - "write_request_per_sec": extraMetrics.WriteRequestCountPerSec, - "read_byte_per_sec": extraMetrics.ReadBytesPerSec, - "write_byte_per_sec": extraMetrics.WriteBytesPerSec, - "avg_request_size": extraMetrics.AvgRequestSize, - "avg_queue_size": extraMetrics.AvgQueueSize, - "await": extraMetrics.AvgAwaitTime, - "service_time": extraMetrics.AvgServiceTime, - "busy": extraMetrics.BusyPct, + "read": common.MapStr{ + "request": common.MapStr{ + "merges_per_sec": extraMetrics.ReadRequestMergeCountPerSec, + "per_sec": extraMetrics.ReadRequestCountPerSec, + }, + "per_sec": common.MapStr{ + "bytes": extraMetrics.ReadBytesPerSec, + }, + }, + "write": common.MapStr{ + "request": common.MapStr{ + "merges_per_sec": extraMetrics.WriteRequestMergeCountPerSec, + "per_sec": extraMetrics.WriteRequestCountPerSec, + }, + "per_sec": common.MapStr{ + "bytes": extraMetrics.WriteBytesPerSec, + }, + }, + "queue": common.MapStr{ + "avg_size": extraMetrics.AvgQueueSize, + }, + "request": common.MapStr{ + "avg_size": extraMetrics.AvgRequestSize, + }, + "await": extraMetrics.AvgAwaitTime, + "service_time": extraMetrics.AvgServiceTime, + "busy": extraMetrics.BusyPct, } } diff --git a/metricbeat/tests/system/test_system.py b/metricbeat/tests/system/test_system.py index 582cc3078f53..10c4b046f047 100644 --- a/metricbeat/tests/system/test_system.py +++ b/metricbeat/tests/system/test_system.py @@ -29,8 +29,8 @@ SYSTEM_DISKIO_FIELDS_LINUX = ["name", "read.count", "write.count", "read.bytes", "write.bytes", "read.time", "write.time", "io.time", - "iostat.read_request_merged_per_sec", "iostat.write_request_merged_per_sec", "iostat.read_request_per_sec", "iostat.write_request_per_sec", "iostat.read_byte_per_sec", "iostat.write_byte_per_sec" - "iostat.avg_request_size", "iostat.avg_queue_size", "iostat.await", "iostat.service_time", "iostat.busy"] + "iostat.read.request.merges_per_sec", "iostat.write.request.merges_per_sec", "iostat.read.request.per_sec", "iostat.write.request.per_sec", "iostat.read.per_sec.bytes", "iostat.write.per_sec.bytes" + "iostat.request.avg_size", "iostat.queue.avg_size", "iostat.await", "iostat.service_time", "iostat.busy"] SYSTEM_FILESYSTEM_FIELDS = ["available", "device_name", "type", "files", "free", "free_files", "mount_point", "total", "used.bytes",