diff --git a/collectors/0/iostat.py b/collectors/0/iostat.py index b3679bea..f3c9c263 100755 --- a/collectors/0/iostat.py +++ b/collectors/0/iostat.py @@ -163,6 +163,7 @@ def main(): device)) ret = is_device(device, 0) + # if a device or a partition, calculate the svctm/await/util""" if ret: stats = dict(zip(FIELDS_DISK, values[3:])) nr_ios = float(stats.get("read_requests")) + float(stats.get("write_requests")) @@ -173,14 +174,14 @@ def main(): if tput: svctm = util / tput - print ("%s%s %d %.2f dev=%s" % (metric, "svctm", ts, svctm, device)) if nr_ios: rd_ticks = stats.get("msec_read") wr_ticks = stats.get("msec_write") await = (float(rd_ticks) + float(wr_ticks)) / float(nr_ios) + print ("%s%s %d %.2f dev=%s" % (metric, "svctm", ts, svctm, device)) print ("%s%s %d %.2f dev=%s" % (metric, "await", ts, await, device)) - #print ("%s%s %d %.2f dev=%s" % (metric, "util", ts, float(util/10.0), device)) + print ("%s%s %d %.2f dev=%s" % (metric, "util", ts, float(util/1000.0), device)) elif len(values) == 7: # partial stats line