From: Venky Shankar Date: Mon, 16 Nov 2020 14:07:39 +0000 (-0500) Subject: mgr/stats: include version with `perf stats` output X-Git-Tag: v16.1.0~84^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9a862d0cda2e995d45e7b8670abf917e1a7ba1fb;p=ceph.git mgr/stats: include version with `perf stats` output So that `fstop` infers the version of mgr/stats to parse the JSON command output. Signed-off-by: Venky Shankar --- diff --git a/src/pybind/mgr/stats/fs/perf_stats.py b/src/pybind/mgr/stats/fs/perf_stats.py index a84c9ad7ac89..f90a5b331581 100644 --- a/src/pybind/mgr/stats/fs/perf_stats.py +++ b/src/pybind/mgr/stats/fs/perf_stats.py @@ -12,6 +12,8 @@ from mgr_module import CommandResult from datetime import datetime, timedelta from threading import Lock, Condition, Thread +PERF_STATS_VERSION = 1 + QUERY_IDS = "query_ids" GLOBAL_QUERY_ID = "global_query_id" QUERY_LAST_REQUEST = "last_time_stamp" @@ -391,6 +393,7 @@ class FSPerfStats(object): def generate_report(self, user_query): result = {} # type: Dict # start with counter info -- metrics that are global and per mds + result["version"] = PERF_STATS_VERSION result["global_counters"] = MDS_GLOBAL_PERF_QUERY_COUNTERS result["counters"] = MDS_PERF_QUERY_COUNTERS