aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/arcstat
diff options
context:
space:
mode:
authorMatthew Thode <[email protected]>2013-11-08 15:52:06 -0600
committerBrian Behlendorf <[email protected]>2013-11-08 14:30:22 -0800
commit23bc1f91fc5694699750be6343070e0d16fbe4ea (patch)
treeb5c2bc016e0164f8f9fc86995f08c31f1d009089 /cmd/arcstat
parent7a4f54688ee9503c5bf9fcd7a88c4b4b33c36572 (diff)
pep8 code readability changes
Update the code to follow the pep8 style guide. References: http://www.python.org/dev/peps/pep-0008/ Signed-off-by: Matthew Thode <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #1838
Diffstat (limited to 'cmd/arcstat')
-rwxr-xr-xcmd/arcstat/arcstat.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/cmd/arcstat/arcstat.py b/cmd/arcstat/arcstat.py
index f703e33cd..24f4aa77e 100755
--- a/cmd/arcstat/arcstat.py
+++ b/cmd/arcstat/arcstat.py
@@ -96,9 +96,9 @@ cols = {
v = {}
hdr = ["time", "read", "miss", "miss%", "dmis", "dm%", "pmis", "pm%", "mmis",
- "mm%", "arcsz", "c"]
+ "mm%", "arcsz", "c"]
xhdr = ["time", "mfu", "mru", "mfug", "mrug", "eskip", "mtxmis", "rmis",
- "dread", "pread", "read"]
+ "dread", "pread", "read"]
sint = 1 # Default interval is 1 second
count = 1 # Default count is 1
hdr_intr = 20 # Print header every 20 lines of output
@@ -107,7 +107,7 @@ sep = " " # Default separator is 2 spaces
version = "0.4"
l2exist = False
cmd = ("Usage: arcstat.py [-hvx] [-f fields] [-o file] [-s string] [interval "
- "[count]]\n")
+ "[count]]\n")
cur = {}
d = {}
out = None
@@ -129,12 +129,12 @@ def usage():
sys.stderr.write("%s\n" % cmd)
sys.stderr.write("\t -h : Print this help message\n")
sys.stderr.write("\t -v : List all possible field headers and definitions"
- "\n")
+ "\n")
sys.stderr.write("\t -x : Print extended stats\n")
sys.stderr.write("\t -f : Specify specific fields to print (see -v)\n")
sys.stderr.write("\t -o : Redirect output to the specified file\n")
sys.stderr.write("\t -s : Override default field separator with custom "
- "character or string\n")
+ "character or string\n")
sys.stderr.write("\nExamples:\n")
sys.stderr.write("\tarcstat.py -o /tmp/a.log 2 10\n")
sys.stderr.write("\tarcstat.py -s \",\" -o /tmp/a.log 2 10\n")
@@ -217,7 +217,7 @@ def print_values():
sys.stdout.write("%s%s" % (
prettynum(cols[col][0], cols[col][1], v[col]),
sep
- ))
+ ))
sys.stdout.write("\n")
@@ -326,9 +326,8 @@ def init():
usage()
if len(incompat) > 0:
- sys.stderr.write("Incompatible field specified! -- %s\n" % (
- incompat,
- ))
+ sys.stderr.write("Incompatible field specified! -- %s\n" %
+ incompat)
usage()
if opfile:
@@ -363,16 +362,16 @@ def calculate():
v["phit"] = (d["prefetch_data_hits"] + d["prefetch_metadata_hits"]) / sint
v["pmis"] = (d["prefetch_data_misses"] +
- d["prefetch_metadata_misses"]) / sint
+ d["prefetch_metadata_misses"]) / sint
v["pread"] = v["phit"] + v["pmis"]
v["ph%"] = 100 * v["phit"] / v["pread"] if v["pread"] > 0 else 0
v["pm%"] = 100 - v["ph%"] if v["pread"] > 0 else 0
v["mhit"] = (d["prefetch_metadata_hits"] +
- d["demand_metadata_hits"]) / sint
+ d["demand_metadata_hits"]) / sint
v["mmis"] = (d["prefetch_metadata_misses"] +
- d["demand_metadata_misses"]) / sint
+ d["demand_metadata_misses"]) / sint
v["mread"] = v["mhit"] + v["mmis"]
v["mh%"] = 100 * v["mhit"] / v["mread"] if v["mread"] > 0 else 0