]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/stats: include version with `perf stats` output
authorVenky Shankar <vshankar@redhat.com>
Mon, 16 Nov 2020 14:07:39 +0000 (09:07 -0500)
committerVenky Shankar <vshankar@redhat.com>
Mon, 11 Jan 2021 11:15:53 +0000 (06:15 -0500)
So that `fstop` infers the version of mgr/stats to parse the
JSON command output.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/pybind/mgr/stats/fs/perf_stats.py

index a84c9ad7ac89291052595aff5672ab383c9a2b13..f90a5b3315816c25af9abfa43d357983b62f52a1 100644 (file)
@@ -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