From: Dan Mick Date: Wed, 12 Jul 2017 05:29:48 +0000 (-0700) Subject: mgr/DaemonServer: add perf_schema_update notification for Py modules X-Git-Tag: v12.1.2~187^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f0e9dcda0c1c0cdd5616560ea6814ba523fd67ae;p=ceph.git mgr/DaemonServer: add perf_schema_update notification for Py modules 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 --- diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 6454c8da306a..48a60035ee9d 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -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();