Skip to content
Permalink
Browse files

Changed decimals to integers in the arcstat script

I changed interval value type from decimal to integer,
because of deprecation warning in Python 3.8 and above.
I also changed kstat values type from decimal to integer,
because all the values are integers.
I removed import of Decimal module too.

Signed-off-by: Bartosz Zieba <bartosz@zieba.pro>
  • Loading branch information
Avatat committed Mar 17, 2020
1 parent 7145123 commit 48e9fac68f23f62939d972cb01f209fedebd4960
Showing with 5 additions and 6 deletions.
  1. +5 −6 cmd/arcstat/arcstat
@@ -51,7 +51,6 @@ import getopt
import re
import copy

from decimal import Decimal
from signal import signal, SIGINT, SIGWINCH, SIG_DFL


@@ -139,7 +138,7 @@ if sys.platform.startswith('freebsd'):

name, value = s.name, s.value
# Trims 'kstat.zfs.misc.arcstats' from the name
kstat[name[24:]] = Decimal(value)
kstat[name[24:]] = int(value)

elif sys.platform.startswith('linux'):
def kstat_update():
@@ -158,7 +157,7 @@ elif sys.platform.startswith('linux'):
continue

name, unused, value = s.split()
kstat[name] = Decimal(value)
kstat[name] = int(value)


def detailed_usage():
@@ -335,15 +334,15 @@ def init():
i += 1

argv = sys.argv[i:]
sint = Decimal(argv[0]) if argv else sint
sint = int(argv[0]) if argv else sint
count = int(argv[1]) if len(argv) > 1 else count

if len(argv) > 1:
sint = Decimal(argv[0])
sint = int(argv[0])
count = int(argv[1])

elif len(argv) > 0:
sint = Decimal(argv[0])
sint = int(argv[0])
count = 0

if hflag or (xflag and desired_cols):

0 comments on commit 48e9fac

Please sign in to comment.
You can’t perform that action at this time.