aboutsummaryrefslogtreecommitdiff
path: root/dio.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-12 03:44:42 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-12 03:44:42 +0100
commit6898d4a1a4a4d9e599da85c4f83b85dd242b0c96 (patch)
treefa774db480a58c32e080b1cb5e58d2f023c63d6b /dio.lua
parent71f21f38c10f0e6a1d788283c198d506d1109a48 (diff)
downloadvicious-legacy-6898d4a1a4a4d9e599da85c4f83b85dd242b0c96.tar.xz
dio: add I/O scheduler support
I/O scheduler information is stored in the key: {sched}
Diffstat (limited to 'dio.lua')
-rw-r--r--dio.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/dio.lua b/dio.lua
index c7f6dce..33f1f34 100644
--- a/dio.lua
+++ b/dio.lua
@@ -26,6 +26,7 @@ local unit = { ["s"] = 1, ["kb"] = 2, ["mb"] = 2048 }
local function worker(format, disk)
local disk_lines = { [disk] = {} }
local disk_stats = helpers.pathtotable("/sys/block/" .. disk)
+ local disk_queue = helpers.pathtotable("/sys/block/" .. disk .. "/queue")
if disk_stats.stat then
local match = string.gmatch(disk_stats.stat, "[%s]+([%d]+)")
@@ -58,6 +59,11 @@ local function worker(format, disk)
helpers.uformat(disk_usage[disk], "write", diff_total[disk][7], unit)
helpers.uformat(disk_usage[disk], "total", diff_total[disk][7] + diff_total[disk][3], unit)
+ -- Store I/O scheduler
+ if disk_queue.scheduler then
+ disk_usage[disk]["{sched}"] = string.gmatch(disk_queue.scheduler, "%[([%a]+)%]")
+ end
+
return disk_usage[disk]
end
-- }}}