Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reef: mgr/telemetry: make sure histograms are formatted in all commands #50481

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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