From 37afdac4d0077ef31875c6459037881c2b706d60 Mon Sep 17 00:00:00 2001 From: Vaibhav Bhembre Date: Tue, 17 May 2016 21:03:54 -0400 Subject: [PATCH] health: fix conflict between ops and bw units --- collectors/health.go | 4 ++-- collectors/health_test.go | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/collectors/health.go b/collectors/health.go index 590a714..f20f973 100644 --- a/collectors/health.go +++ b/collectors/health.go @@ -31,8 +31,8 @@ var ( recoveryIORateRegex = regexp.MustCompile(`(\d+) (\w{2})/s`) recoveryIOKeysRegex = regexp.MustCompile(`(\d+) keys/s`) recoveryIOObjectsRegex = regexp.MustCompile(`(\d+) objects/s`) - clientIOReadRegex = regexp.MustCompile(`(\d+) (\w{2})/s rd`) - clientIOWriteRegex = regexp.MustCompile(`(\d+) (\w{2})/s wr`) + clientIOReadRegex = regexp.MustCompile(`(\d+) (\w[bB])/s rd`) + clientIOWriteRegex = regexp.MustCompile(`(\d+) (\w[bB])/s wr`) clientIOReadOpsRegex = regexp.MustCompile(`(\d+) op/s rd`) clientIOWriteOpsRegex = regexp.MustCompile(`(\d+) op/s wr`) diff --git a/collectors/health_test.go b/collectors/health_test.go index 8d5e906..9736d67 100644 --- a/collectors/health_test.go +++ b/collectors/health_test.go @@ -309,14 +309,12 @@ $ sudo ceph -s health HEALTH_OK monmap e3: 3 mons at {mon01,mon02,mon03} recovery io 5779 MB/s, 4 keys/s, 1522 objects/s - client io 4273 kB/s rd, 2740 MB/s wr, 2863 op/s rd, 5847 op/s wr + client io 2863 op/s rd, 5847 op/s wr `, regexes: []*regexp.Regexp{ regexp.MustCompile(`recovery_io_bytes 5.779e`), regexp.MustCompile(`recovery_io_keys 4`), regexp.MustCompile(`recovery_io_objects 1522`), - regexp.MustCompile(`client_io_read_bytes 4.273e`), - regexp.MustCompile(`client_io_write_bytes 2.74e`), regexp.MustCompile(`client_io_ops 8710`), regexp.MustCompile(`client_io_read_ops 2863`), regexp.MustCompile(`client_io_write_ops 5847`),