mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Add FreeBSD code to arc_summary and arcstat
Adding the FreeBSD code allows arc_summary and arcstat to be used on FreeBSD. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9641
This commit is contained in:
committed by
Brian Behlendorf
parent
c54687cd23
commit
101f9b1771
@@ -55,7 +55,20 @@ from subprocess import Popen, PIPE
|
||||
from decimal import Decimal as D
|
||||
|
||||
|
||||
if sys.platform.startswith('linux'):
|
||||
if sys.platform.startswith('freebsd'):
|
||||
# Requires py27-sysctl on FreeBSD
|
||||
import sysctl
|
||||
|
||||
def load_kstats(namespace):
|
||||
"""Collect information on a specific subsystem of the ARC"""
|
||||
|
||||
base = 'kstat.zfs.misc.%s.' % namespace
|
||||
return [(kstat.name, D(kstat.value)) for kstat in sysctl.filter(base)]
|
||||
|
||||
def load_tunables():
|
||||
return dict((ctl.name, ctl.value) for ctl in sysctl.filter('vfs.zfs'))
|
||||
|
||||
elif sys.platform.startswith('linux'):
|
||||
|
||||
def load_kstats(namespace):
|
||||
"""Collect information on a specific subsystem of the ARC"""
|
||||
|
||||
Reference in New Issue
Block a user