]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: expose get_counter in MgrModule
authorJohn Spray <john.spray@redhat.com>
Tue, 26 Jul 2016 12:59:19 +0000 (13:59 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 29 Sep 2016 16:27:01 +0000 (17:27 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/pybind/mgr/mgr_module.py

index 725af381ca054b6dc41ca64505ac78bc718b4766..19e135c6824aff551ee3a0ff128f5fe0ffa2cd64 100644 (file)
@@ -102,6 +102,18 @@ class MgrModule(object):
         """
         return ceph_state.get_server(self._handle, hostname)
 
+    def get_counter(self, svc_type, svc_name, path):
+        """
+        Called by the plugin to fetch data for a particular perf counter
+        on a particular service.
+
+        :param svc_type:
+        :param svc_name:
+        :param path:
+        :return: A list of two-element lists containing time and value
+        """
+        return ceph_state.get_counter(self._handle, svc_type, svc_name, path)
+
     def list_servers(self):
         """
         Like ``get_server``, but instead of returning information