From: Yaarit Hatuka Date: Wed, 12 Jan 2022 23:33:08 +0000 (+0000) Subject: mgr/telemetry: revise format_perf_histogram X-Git-Tag: v17.1.0~50^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2197f7ee01e4d4183dee87be18b6bd8183ee1c5f;p=ceph.git mgr/telemetry: revise format_perf_histogram osd_perf_histograms now include only separated stats; remove the aggregated formatting; we can revert this in case we ever add aggregated histograms. Signed-off-by: Yaarit Hatuka --- diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index ca039afe611bc..45baa1a5cc5ca 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -1295,22 +1295,17 @@ class Module(MgrModule): # they are displayed horizontally instead of vertically. try: # Formatting ranges and values in osd_perf_histograms - modes_to_be_formatted = ['osd_perf_histograms_aggregated', 'osd_perf_histograms_separated'] - for mode in modes_to_be_formatted: - for config in report[mode]: - for histogram in config: - # Adjust ranges by converting lists into strings - for axis in config[histogram]['axes']: - for i in range(0, len(axis['ranges'])): - axis['ranges'][i] = str(axis['ranges'][i]) - # Adjust values by converting lists into strings - if mode == 'osd_perf_histograms_aggregated': - for i in range(0, len(config[histogram]['values'])): - config[histogram]['values'][i] = str(config[histogram]['values'][i]) - else: # if mode == 'osd_perf_histograms_separated' - for osd in config[histogram]['osds']: - for i in range(0, len(osd['values'])): - osd['values'][i] = str(osd['values'][i]) + mode = 'osd_perf_histograms' + for config in report[mode]: + for histogram in config: + # Adjust ranges by converting lists into strings + for axis in config[histogram]['axes']: + for i in range(0, len(axis['ranges'])): + axis['ranges'][i] = str(axis['ranges'][i]) + + for osd in config[histogram]['osds']: + for i in range(0, len(osd['values'])): + osd['values'][i] = str(osd['values'][i]) except KeyError: # If the perf channel is not enabled, there should be a KeyError since # 'osd_perf_histograms' would not be present in the report. In that case,