From 53cf95ffdf9f771b27f9377a03d480cf8f50cabf Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Wed, 13 Apr 2022 14:20:07 -0700 Subject: [PATCH 1/2] lustre: add support for Lustre 2.12+ --- plugins/dool_lustre.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/dool_lustre.py b/plugins/dool_lustre.py index 379dd7b..c443876 100644 --- a/plugins/dool_lustre.py +++ b/plugins/dool_lustre.py @@ -3,22 +3,28 @@ class dstat_plugin(dstat): def __init__(self): self.nick = ('read', 'write') - self.cols = 2 + self.cols = 2 + self.stat_path = '/proc/fs/lustre/llite' def check(self): - if not os.path.exists('/proc/fs/lustre/llite'): + if os.path.exists('/proc/fs/lustre/llite'): + self.stat_path = '/proc/fs/lustre/llite' + elif os.path.exists('/sys/kernel/debug/lustre/llite'): + self.stat_path = '/sys/kernel/debug/lustre/llite' + else: raise Exception('Lustre filesystem not found') info(1, 'Module %s is still experimental.' % self.filename) def name(self): - return [mount for mount in os.listdir('/proc/fs/lustre/llite')] + return [mount for mount in os.listdir(self.stat_path)] def vars(self): - return [mount for mount in os.listdir('/proc/fs/lustre/llite')] + return [mount for mount in os.listdir(self.stat_path)] def extract(self): for name in self.vars: - for line in dopen(os.path.join('/proc/fs/lustre/llite', name, 'stats')).readlines(): + read = write = 0 + for line in dopen(os.path.join(self.stat_path, name, 'stats')).readlines(): l = line.split() if len(l) < 6: continue if l[0] == 'read_bytes': From 8528c1db09ad4c8d64205278f44a97287ad29a20 Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Wed, 13 Apr 2022 14:19:38 -0700 Subject: [PATCH 2/2] lustre: fix author name --- plugins/dool_lustre.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dool_lustre.py b/plugins/dool_lustre.py index c443876..3abc730 100644 --- a/plugins/dool_lustre.py +++ b/plugins/dool_lustre.py @@ -1,4 +1,4 @@ -# Author: Brock Palen , Kilian Vavalotti +# Author: Brock Palen , Kilian Cavalotti class dstat_plugin(dstat): def __init__(self):