]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/telemetry: define an actual function for stats_per_pg
authorLaura Flores <lflores@redhat.com>
Thu, 16 Dec 2021 07:04:51 +0000 (07:04 +0000)
committerLaura Flores <lflores@redhat.com>
Wed, 22 Dec 2021 19:15:53 +0000 (19:15 +0000)
This creates uniformity among the other functions, and makes it
so we can easily edit the content of this function if needed.

Signed-off-by: Laura Flores <lflores@redhat.com>
src/pybind/mgr/telemetry/module.py

index 68ca97c1af4fe85728a5cd80082ee8c040ad9f3f..57a9fd4ae382789f05829e761673cd1869c2f030 100644 (file)
@@ -520,6 +520,9 @@ class Module(MgrModule):
 
         return result
 
+    def get_stats_per_pg(self) -> dict:
+        return self.get('pg_dump')['pg_stats']
+
     def gather_crashinfo(self) -> List[Dict[str, str]]:
         crashlist: List[Dict[str, str]] = list()
         errno, crashids, err = self.remote('crash', 'ls')
@@ -970,7 +973,7 @@ class Module(MgrModule):
         if 'perf' in channels:
             report['perf_counters'] = self.gather_perf_counters('separated')
             report['stats_per_pool'] = self.get_stats_per_pool()
-            report['stats_per_pg'] = self.get('pg_dump')['pg_stats']
+            report['stats_per_pg'] = self.get_stats_per_pg()
             report['io_rate'] = self.get_io_rate()
             report['osd_perf_histograms'] = self.get_osd_histograms('separated')
             report['mempool'] = self.get_mempool('separated')