]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/iostat: update iostat to use the 'poll' flag
authorMohamad Gebai <mgebai@suse.com>
Wed, 28 Feb 2018 23:21:48 +0000 (18:21 -0500)
committerMohamad Gebai <mgebai@suse.com>
Thu, 12 Apr 2018 04:26:24 +0000 (00:26 -0400)
Signed-off-by: Mohamad Gebai <mgebai@suse.com>
src/ceph.in
src/pybind/mgr/iostat/module.py

index 9bc8a1fcef4417896bab902f8c8d753f52a49c01..45b854f88d9354530929e941863bb071e1f4eeb0 100755 (executable)
@@ -1080,16 +1080,6 @@ def main():
         print('error handling command target: {0}'.format(e), file=sys.stderr)
         return 1
 
-    # ceph iostat
-    if len(childargs) > 0 and childargs[0] == 'iostat':
-        def call_iostat():
-            while 1:
-                subprocess.call([sys.argv[0], 'mgr', 'iostat'])
-                sleep(1)
-
-        run_in_thread(call_iostat)
-        return 1
-
     # Repulsive hack to handle tell: lop off 'tell' and target
     # and validate the rest of the command.  'target' is already
     # determined in our callers, so it's ok to remove it here.
index bb0de7183aeaa60c007776e0e6f02e7d92950c31..470ba83525c9fbd717cec227843af8efb0550fbc 100644 (file)
@@ -5,8 +5,8 @@ from mgr_module import MgrModule
 class Module(MgrModule):
     COMMANDS = [
         {
-            "cmd": "mgr iostat",
-            "desc": "Get IO rates v3",
+            "cmd": "iostat",
+            "desc": "Get IO rates",
             "perm": "r",
             "poll": "true"
         }
@@ -22,7 +22,7 @@ class Module(MgrModule):
         wr = 0
         ops = 0
 
-        if command['prefix'] == 'mgr iostat':
+        if command['prefix'] == 'iostat':
             r = self.get('io_rate')
 
             stamp_delta = float(r['pg_stats_delta']['stamp_delta'])