From c1ebeb1e38140fb1ed532f459c360a3c32a4dc8a Mon Sep 17 00:00:00 2001 From: Sven Wiltink Date: Wed, 2 Jan 2019 16:35:57 +0100 Subject: [PATCH 1/5] added the read and write op per second fields --- plugins/inputs/ceph/ceph.go | 22 +++++++++++++--------- plugins/inputs/ceph/ceph_test.go | 24 ++++++++++++++---------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/plugins/inputs/ceph/ceph.go b/plugins/inputs/ceph/ceph.go index 95f50958c6d9f..5bbceb58eb718 100644 --- a/plugins/inputs/ceph/ceph.go +++ b/plugins/inputs/ceph/ceph.go @@ -345,6 +345,8 @@ type CephStatus struct { ReadBytesSec float64 `json:"read_bytes_sec"` WriteBytesSec float64 `json:"write_bytes_sec"` OpPerSec float64 `json:"op_per_sec"` + ReadOpPerSec float64 `json:"read_op_per_sec"` + WriteOpPerSec float64 `json:"write_op_per_sec"` } `json:"pgmap"` } @@ -388,15 +390,17 @@ func decodeStatusOsdmap(acc telegraf.Accumulator, data *CephStatus) error { // decodeStatusPgmap decodes the PG map portion of the output of 'ceph -s' func decodeStatusPgmap(acc telegraf.Accumulator, data *CephStatus) error { fields := map[string]interface{}{ - "version": data.PGMap.Version, - "num_pgs": data.PGMap.NumPGs, - "data_bytes": data.PGMap.DataBytes, - "bytes_used": data.PGMap.BytesUsed, - "bytes_avail": data.PGMap.BytesAvail, - "bytes_total": data.PGMap.BytesTotal, - "read_bytes_sec": data.PGMap.ReadBytesSec, - "write_bytes_sec": data.PGMap.WriteBytesSec, - "op_per_sec": data.PGMap.OpPerSec, + "version": data.PGMap.Version, + "num_pgs": data.PGMap.NumPGs, + "data_bytes": data.PGMap.DataBytes, + "bytes_used": data.PGMap.BytesUsed, + "bytes_avail": data.PGMap.BytesAvail, + "bytes_total": data.PGMap.BytesTotal, + "read_bytes_sec": data.PGMap.ReadBytesSec, + "write_bytes_sec": data.PGMap.WriteBytesSec, + "op_per_sec": data.PGMap.OpPerSec, + "read_op_per_sec": data.PGMap.ReadOpPerSec, + "write_op_per_sec": data.PGMap.WriteOpPerSec, } acc.AddFields("ceph_pgmap", fields, map[string]string{}) return nil diff --git a/plugins/inputs/ceph/ceph_test.go b/plugins/inputs/ceph/ceph_test.go index a0365c8fbccfe..6bbdf1861ef42 100644 --- a/plugins/inputs/ceph/ceph_test.go +++ b/plugins/inputs/ceph/ceph_test.go @@ -835,7 +835,9 @@ var clusterStatusDump = ` "bytes_total": 17335810048000, "read_bytes_sec": 0, "write_bytes_sec": 367217, - "op_per_sec": 98 + "op_per_sec": 98, + "read_op_per_sec": 322, + "write_op_per_sec": 1022 }, "mdsmap": { "epoch": 1, @@ -864,15 +866,17 @@ var cephStatusResults = []expectedResult{ { metric: "ceph_pgmap", fields: map[string]interface{}{ - "version": float64(52314277), - "num_pgs": float64(2560), - "data_bytes": float64(2700031960713), - "bytes_used": float64(7478347665408), - "bytes_avail": float64(9857462382592), - "bytes_total": float64(17335810048000), - "read_bytes_sec": float64(0), - "write_bytes_sec": float64(367217), - "op_per_sec": float64(98), + "version": float64(52314277), + "num_pgs": float64(2560), + "data_bytes": float64(2700031960713), + "bytes_used": float64(7478347665408), + "bytes_avail": float64(9857462382592), + "bytes_total": float64(17335810048000), + "read_bytes_sec": float64(0), + "write_bytes_sec": float64(367217), + "op_per_sec": float64(98), + "read_op_per_sec": float64(322), + "write_op_per_sec": float64(1022), }, tags: map[string]string{}, }, From c8f144b761cad8658d8527587820c239c8b1687c Mon Sep 17 00:00:00 2001 From: Sven Wiltink Date: Wed, 2 Jan 2019 16:49:47 +0100 Subject: [PATCH 2/5] updated readme --- plugins/inputs/ceph/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/inputs/ceph/README.md b/plugins/inputs/ceph/README.md index 8d04c54b28f41..746fc7580f054 100644 --- a/plugins/inputs/ceph/README.md +++ b/plugins/inputs/ceph/README.md @@ -109,6 +109,8 @@ All fields are collected under the **ceph** measurement and stored as float64s. * data\_bytes (float) * num\_pgs (float) * op\_per\_sec (float) + * read_op\_per\_sec (float) + * write_op\_per\_sec (float) * read\_bytes\_sec (float) * version (float) * write\_bytes\_sec (float) From b8320b22d1ac54580a701bae876d4c34c6852cd0 Mon Sep 17 00:00:00 2001 From: Sven Wiltink Date: Wed, 2 Jan 2019 17:04:55 +0100 Subject: [PATCH 3/5] added read and write op per sec to osd pool stats --- plugins/inputs/ceph/ceph.go | 4 ++++ plugins/inputs/ceph/ceph_test.go | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/inputs/ceph/ceph.go b/plugins/inputs/ceph/ceph.go index 5bbceb58eb718..59c705a897114 100644 --- a/plugins/inputs/ceph/ceph.go +++ b/plugins/inputs/ceph/ceph.go @@ -475,6 +475,8 @@ type CephOSDPoolStats []struct { ReadBytesSec float64 `json:"read_bytes_sec"` WriteBytesSec float64 `json:"write_bytes_sec"` OpPerSec float64 `json:"op_per_sec"` + ReadOpPerSec float64 `json:"read_op_per_sec"` + WriteOpPerSec float64 `json:"write_op_per_sec"` } `json:"client_io_rate"` RecoveryRate struct { RecoveringObjectsPerSec float64 `json:"recovering_objects_per_sec"` @@ -499,6 +501,8 @@ func decodeOsdPoolStats(acc telegraf.Accumulator, input string) error { "read_bytes_sec": pool.ClientIORate.ReadBytesSec, "write_bytes_sec": pool.ClientIORate.WriteBytesSec, "op_per_sec": pool.ClientIORate.OpPerSec, + "read_op_per_sec": pool.ClientIORate.ReadOpPerSec, + "write_op_per_sec": pool.ClientIORate.WriteOpPerSec, "recovering_objects_per_sec": pool.RecoveryRate.RecoveringObjectsPerSec, "recovering_bytes_per_sec": pool.RecoveryRate.RecoveringBytesPerSec, "recovering_keys_per_sec": pool.RecoveryRate.RecoveringKeysPerSec, diff --git a/plugins/inputs/ceph/ceph_test.go b/plugins/inputs/ceph/ceph_test.go index 6bbdf1861ef42..ee2f96491d47a 100644 --- a/plugins/inputs/ceph/ceph_test.go +++ b/plugins/inputs/ceph/ceph_test.go @@ -1018,7 +1018,9 @@ var cephODSPoolStatsDump = ` "recovering_keys_per_sec": 0}, "client_io_rate": { "read_bytes_sec": 10566067, "write_bytes_sec": 15165220376, - "op_per_sec": 9828}}]` + "op_per_sec": 9828, + "read_op_per_sec": 182, + "write_op_per_sec": 473}}]` var cephOSDPoolStatsResults = []expectedResult{ { @@ -1027,6 +1029,8 @@ var cephOSDPoolStatsResults = []expectedResult{ "read_bytes_sec": float64(0), "write_bytes_sec": float64(0), "op_per_sec": float64(0), + "read_op_per_sec": float64(0), + "write_op_per_sec": float64(0), "recovering_objects_per_sec": float64(0), "recovering_bytes_per_sec": float64(0), "recovering_keys_per_sec": float64(0), @@ -1041,6 +1045,8 @@ var cephOSDPoolStatsResults = []expectedResult{ "read_bytes_sec": float64(10566067), "write_bytes_sec": float64(15165220376), "op_per_sec": float64(9828), + "read_op_per_sec": float64(182), + "write_op_per_sec": float64(473), "recovering_objects_per_sec": float64(279), "recovering_bytes_per_sec": float64(176401059), "recovering_keys_per_sec": float64(0), From 8f4360796b4431f31ccd451a9463438dcaa0b84b Mon Sep 17 00:00:00 2001 From: Sven Wiltink Date: Wed, 2 Jan 2019 17:06:44 +0100 Subject: [PATCH 4/5] updated readme --- plugins/inputs/ceph/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/inputs/ceph/README.md b/plugins/inputs/ceph/README.md index 746fc7580f054..24e807ed0ce07 100644 --- a/plugins/inputs/ceph/README.md +++ b/plugins/inputs/ceph/README.md @@ -135,6 +135,8 @@ All fields are collected under the **ceph** measurement and stored as float64s. * ceph\_pool\_stats * op\_per\_sec (float) + * read_op\_per\_sec (float) + * write_op\_per\_sec (float) * read\_bytes\_sec (float) * write\_bytes\_sec (float) * recovering\_object\_per\_sec (float) From 2a084bd6ae89d2102f7af3925bfcfdcf433ac3f2 Mon Sep 17 00:00:00 2001 From: Sven Wiltink Date: Wed, 2 Jan 2019 21:16:55 +0100 Subject: [PATCH 5/5] added the ceph version change to the documentation --- plugins/inputs/ceph/README.md | 4 ++-- plugins/inputs/ceph/ceph.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/inputs/ceph/README.md b/plugins/inputs/ceph/README.md index 24e807ed0ce07..c53f908ab413e 100644 --- a/plugins/inputs/ceph/README.md +++ b/plugins/inputs/ceph/README.md @@ -108,7 +108,7 @@ All fields are collected under the **ceph** measurement and stored as float64s. * bytes\_used (float) * data\_bytes (float) * num\_pgs (float) - * op\_per\_sec (float) + * op\_per\_sec (float, ceph < 10) * read_op\_per\_sec (float) * write_op\_per\_sec (float) * read\_bytes\_sec (float) @@ -134,7 +134,7 @@ All fields are collected under the **ceph** measurement and stored as float64s. * objects (float) * ceph\_pool\_stats - * op\_per\_sec (float) + * op\_per\_sec (float, ceph < 10) * read_op\_per\_sec (float) * write_op\_per\_sec (float) * read\_bytes\_sec (float) diff --git a/plugins/inputs/ceph/ceph.go b/plugins/inputs/ceph/ceph.go index 59c705a897114..b6a6c5c080b4b 100644 --- a/plugins/inputs/ceph/ceph.go +++ b/plugins/inputs/ceph/ceph.go @@ -344,7 +344,7 @@ type CephStatus struct { BytesTotal float64 `json:"bytes_total"` ReadBytesSec float64 `json:"read_bytes_sec"` WriteBytesSec float64 `json:"write_bytes_sec"` - OpPerSec float64 `json:"op_per_sec"` + OpPerSec float64 `json:"op_per_sec"` // This field is no longer reported in ceph 10 and later ReadOpPerSec float64 `json:"read_op_per_sec"` WriteOpPerSec float64 `json:"write_op_per_sec"` } `json:"pgmap"` @@ -398,7 +398,7 @@ func decodeStatusPgmap(acc telegraf.Accumulator, data *CephStatus) error { "bytes_total": data.PGMap.BytesTotal, "read_bytes_sec": data.PGMap.ReadBytesSec, "write_bytes_sec": data.PGMap.WriteBytesSec, - "op_per_sec": data.PGMap.OpPerSec, + "op_per_sec": data.PGMap.OpPerSec, // This field is no longer reported in ceph 10 and later "read_op_per_sec": data.PGMap.ReadOpPerSec, "write_op_per_sec": data.PGMap.WriteOpPerSec, } @@ -474,7 +474,7 @@ type CephOSDPoolStats []struct { ClientIORate struct { ReadBytesSec float64 `json:"read_bytes_sec"` WriteBytesSec float64 `json:"write_bytes_sec"` - OpPerSec float64 `json:"op_per_sec"` + OpPerSec float64 `json:"op_per_sec"` // This field is no longer reported in ceph 10 and later ReadOpPerSec float64 `json:"read_op_per_sec"` WriteOpPerSec float64 `json:"write_op_per_sec"` } `json:"client_io_rate"` @@ -500,7 +500,7 @@ func decodeOsdPoolStats(acc telegraf.Accumulator, input string) error { fields := map[string]interface{}{ "read_bytes_sec": pool.ClientIORate.ReadBytesSec, "write_bytes_sec": pool.ClientIORate.WriteBytesSec, - "op_per_sec": pool.ClientIORate.OpPerSec, + "op_per_sec": pool.ClientIORate.OpPerSec, // This field is no longer reported in ceph 10 and later "read_op_per_sec": pool.ClientIORate.ReadOpPerSec, "write_op_per_sec": pool.ClientIORate.WriteOpPerSec, "recovering_objects_per_sec": pool.RecoveryRate.RecoveringObjectsPerSec,