From 9a862d0cda2e995d45e7b8670abf917e1a7ba1fb Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Mon, 16 Nov 2020 09:07:39 -0500 Subject: [PATCH] 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 --- src/pybind/mgr/stats/fs/perf_stats.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pybind/mgr/stats/fs/perf_stats.py b/src/pybind/mgr/stats/fs/perf_stats.py index a84c9ad7ac8..f90a5b33158 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 -- 2.39.5