1. Erik van Zijst
  2. nfs-analyser

Commits

Erik van Zijst  committed cee1951

Some simple scripts to mine the nfs dir listing.

  • Participants
  • Branches default

Comments (0)

Files changed (3)

File count.py

View file
+import sys
+
+input = sys.stdin
+
+max = 64 * 1024
+
+count = 0
+for line in input:
+    val = long(line)
+    if val < max:
+        count += 1
+
+print count

File sizes.py

View file
+import sys
+import math
+
+input = sys.stdin
+
+buckets = {
+    0: 0,
+    1: 0,
+    2: 0,
+    3: 0,
+    4: 0,
+    5: 0,
+    6: 0,
+    7: 0,
+    8: 0,
+    9: 0,
+    10: 0,
+    11: 0,
+    12: 0
+}
+for line in input:
+
+    value = long(line)
+    magnitude = int(math.log10(value)) if value != 0 else 0
+    buckets[magnitude] += 1
+
+for size, count in buckets.items():
+    print '%d: %d' % (size, count)

File sum.py

View file
+import sys
+
+input = sys.stdin
+
+sum = 0
+for line in input:
+    sum += long(line)
+
+print sum