Skip to content

Commit

Permalink
Merge pull request #24 from stanford-rc/lustre_fixes
Browse files Browse the repository at this point in the history
Add support for Lustre 2.12+ in the `lustre` plugin
  • Loading branch information
scottchiefbaker authored Jun 5, 2023
2 parents 6b4ab28 + 8528c1d commit afd12f5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions plugins/dool_lustre.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# Author: Brock Palen <brockp@mlds-networks.com>, Kilian Vavalotti <kilian@stanford.edu>
# Author: Brock Palen <brockp@mlds-networks.com>, Kilian Cavalotti <kilian@stanford.edu>

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':
Expand Down

0 comments on commit afd12f5

Please sign in to comment.