Skip to content

Commit

Permalink
Merge pull request #50481 from ljflores/wip-tracker-58050-reef
Browse files Browse the repository at this point in the history
reef: mgr/telemetry: make sure histograms are formatted in `all` commands

Reviewed-by: Yaarit Hatuka <yaarithatuka@gmail.com>
  • Loading branch information
yuriw committed Mar 31, 2023
2 parents d50c609 + 2de6ded commit 422f77f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/pybind/mgr/telemetry/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,8 @@ def format_perf_histogram(self, report: Dict[str, Any]) -> None:
# Formatting the perf histograms so they are human-readable. This will change the
# ranges and values, which are currently in list form, into strings so that
# they are displayed horizontally instead of vertically.
if 'report' in report:
report = report['report']
try:
# Formatting ranges and values in osd_perf_histograms
mode = 'osd_perf_histograms'
Expand Down Expand Up @@ -1937,10 +1939,13 @@ def show_all(self) -> Tuple[int, str, str]:

if not self.channel_device:
# device channel is off, no need to display its report
return 0, json.dumps(self.get_report_locked('default'), indent=4, sort_keys=True), ''
report = self.get_report_locked('default')
else:
# telemetry is on and device channel is enabled, show both
report = self.get_report_locked('all')

# telemetry is on and device channel is enabled, show both
return 0, json.dumps(self.get_report_locked('all'), indent=4, sort_keys=True), ''
self.format_perf_histogram(report)
return 0, json.dumps(report, indent=4, sort_keys=True), ''

@CLIReadCommand('telemetry preview-all')
def preview_all(self) -> Tuple[int, str, str]:
Expand Down

0 comments on commit 422f77f

Please sign in to comment.