Merge pull request #25908 from trociny/wip-dperf-bytes

mgr: change 'bytes' dynamic perf counters to COUNTER type

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2019-01-11 14:42:40 -05:00 committed by GitHub
commit 0d8b41f10d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View File

@ -46,10 +46,10 @@ void PerformanceCounterDescriptor::pack_counter(const PerformanceCounter &c,
case PerformanceCounterType::OPS:
case PerformanceCounterType::WRITE_OPS:
case PerformanceCounterType::READ_OPS:
break;
case PerformanceCounterType::BYTES:
case PerformanceCounterType::WRITE_BYTES:
case PerformanceCounterType::READ_BYTES:
break;
case PerformanceCounterType::LATENCY:
case PerformanceCounterType::WRITE_LATENCY:
case PerformanceCounterType::READ_LATENCY:
@ -68,10 +68,10 @@ void PerformanceCounterDescriptor::unpack_counter(
case PerformanceCounterType::OPS:
case PerformanceCounterType::WRITE_OPS:
case PerformanceCounterType::READ_OPS:
break;
case PerformanceCounterType::BYTES:
case PerformanceCounterType::WRITE_BYTES:
case PerformanceCounterType::READ_BYTES:
break;
case PerformanceCounterType::LATENCY:
case PerformanceCounterType::WRITE_LATENCY:
case PerformanceCounterType::READ_LATENCY:

View File

@ -78,18 +78,15 @@ public:
return;
case PerformanceCounterType::BYTES:
c->first += inb + outb;
c->second++;
return;
case PerformanceCounterType::WRITE_BYTES:
if (op.may_write() || op.may_cache()) {
c->first += inb;
c->second++;
}
return;
case PerformanceCounterType::READ_BYTES:
if (op.may_read()) {
c->first += outb;
c->second++;
}
return;
case PerformanceCounterType::LATENCY:

View File

@ -182,9 +182,9 @@ class Module(MgrModule):
'desc' : 'RBD image writes count'},
'read_ops' : {'type' : self.PERFCOUNTER_COUNTER,
'desc' : 'RBD image reads count'},
'write_bytes' : {'type' : self.PERFCOUNTER_LONGRUNAVG,
'write_bytes' : {'type' : self.PERFCOUNTER_COUNTER,
'desc' : 'RBD image bytes written'},
'read_bytes' : {'type' : self.PERFCOUNTER_LONGRUNAVG,
'read_bytes' : {'type' : self.PERFCOUNTER_COUNTER,
'desc' : 'RBD image bytes read'},
'write_latency' : {'type' : self.PERFCOUNTER_LONGRUNAVG,
'desc' : 'RBD image writes latency (msec)'},