Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Lustre 2.12+ in the lustre plugin #24

Merged
merged 2 commits into from
Jun 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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