aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Castillo <jcastillo@redhat.com>2020-05-15 15:41:26 +0100
committerJake Hunsaker <jhunsake@redhat.com>2020-05-26 09:51:48 -0400
commitfc71d8beb06c58aadccc267a5db3e78b04716f1e (patch)
treee355c544320230d856566e22515f7195a33639b7
parent7384e95f3ea157b981ae75be6f4941deb9aacceb (diff)
downloadsos-fc71d8beb06c58aadccc267a5db3e78b04716f1e.tar.gz
[process] Collect iotop
Collect the output of the 'iotop' command by specifying the number of samples in the command line with the option 'samples', with 0.5 seconds delay between each one. By default we capture 20 samples. Resolves: #2024 Signed-off-by: Jose Castillo <jcastillo@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/process.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sos/report/plugins/process.py b/sos/report/plugins/process.py
index ac2a7d8c..81891c09 100644
--- a/sos/report/plugins/process.py
+++ b/sos/report/plugins/process.py
@@ -21,7 +21,9 @@ class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin, CosPlugin):
("lsof", "gathers information on all open files", "slow", True),
("lsof-threads", "gathers threads' open file info if supported",
"slow", False),
- ("smaps", "gathers all /proc/*/smaps files", "", False)
+ ("smaps", "gathers all /proc/*/smaps files", "", False),
+ ("samples", "specify the number of samples that iotop will capture, "
+ "with an interval of 0.5 seconds between samples", "", "20")
]
def setup(self):
@@ -55,4 +57,7 @@ class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin, CosPlugin):
"%s %s" % (ps_axo, ps_sched_opts)
])
+ if self.get_option("samples"):
+ self.add_cmd_output("iotop -b -o -d 0.5 -t -n %s"
+ % self.get_option("samples"))
# vim: set et ts=4 sw=4 :