Created
August 9, 2017 13:09
-
-
Save joefutrelle/501509848aa4328b5e278d9b0e23e171 to your computer and use it in GitHub Desktop.
computes rate of mods to files in a directory and reports in files/hr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import os | |
import sys | |
DIR=sys.argv[1] | |
times = [] | |
for fn in os.listdir(DIR): | |
path = os.path.join(DIR, fn) | |
stat = os.stat(path) | |
times.append(stat.st_mtime) | |
files = len(times) | |
hrs = (max(times) - min(times)) / 60 / 60 | |
print('{:.2f} files/hr'.format(files/hrs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment