]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: add perf_schema_update notification for Py modules
authorDan Mick <dan.mick@redhat.com>
Wed, 12 Jul 2017 05:29:48 +0000 (22:29 -0700)
committerDan Mick <dan.mick@redhat.com>
Tue, 18 Jul 2017 20:27:10 +0000 (13:27 -0700)
MMgrReport contains info about changed schema, so create a notify
type for it so that Python modules interested in perf counters can
update schema only when it changes

Signed-off-by: Dan Mick <dan.mick@redhat.com>
src/mgr/DaemonServer.cc

index 6454c8da306a52b96bd631527f2b61c2dc09e5b9..48a60035ee9d44d19e8c94afcea25261825f98f7 100644 (file)
@@ -386,6 +386,12 @@ bool DaemonServer::handle_report(MMgrReport *m)
   assert(daemon != nullptr);
   auto &daemon_counters = daemon->perf_counters;
   daemon_counters.update(m);
+  // if there are any schema updates, notify the python modules
+  if (!m->declare_types.empty() || !m->undeclare_types.empty()) {
+    ostringstream oss;
+    oss << key.first << '.' << key.second;
+    py_modules.notify_all("perf_schema_update", oss.str());
+  }
 
   if (daemon->service_daemon) {
     utime_t now = ceph_clock_now();