Created
May 31, 2015 12:55
-
-
Save yuvipanda/708ce75cae9f15fedb42 to your computer and use it in GitHub Desktop.
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
# No caching at all | |
~/c/ores-stress $ python3.4 /tmp/test.py 'data/tools-static.wmflabs.org/lolrrit-wm/1/*.out' | |
inflights | |
mean 1.756802902571764 | |
median 1 | |
pstdev 2.4299546779621792 | |
latency | |
mean 1724.702838648917 | |
median 838.930203 | |
pstdev 2159.033094872801 | |
# nginx caching, no delay / priming | |
~/c/ores-stress $ python3.4 /tmp/test.py 'data/tools-static.wmflabs.org/lolrrit-wm/2/*.out' | |
inflights | |
mean 2.026774252704933 | |
median 1 | |
pstdev 2.230940052757951 | |
latency | |
mean 1701.3539797003482 | |
median 963.50666 | |
pstdev 1938.0075171622725 | |
# nginx caching, delay | |
~/c/ores-stress $ python3.4 /tmp/test.py 'data/tools-static.wmflabs.org/lolrrit-wm/3/*.out' | |
inflights | |
mean 3.918343653250774 | |
median 2.0 | |
pstdev 4.978816212595768 | |
latency | |
mean 2417.0321543610685 | |
median 885.054787 | |
pstdev 3648.74529846867 | |
# nginx caching, priming + delay | |
~/c/ores-stress $ python3.4 /tmp/test.py 'data/tools-static.wmflabs.org/lolrrit-wm/4/*.out' | |
inflights | |
mean 2.1061302681992338 | |
median 1.0 | |
pstdev 2.421693299147825 | |
latency | |
mean 2022.3888741293106 | |
median 1045.764082 | |
pstdev 2503.281584788331 |
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
import sys | |
import statistics | |
import glob | |
import csv | |
files = glob.glob(sys.argv[1]) | |
data = [] | |
for file in files: | |
with open(file) as f: | |
reader = csv.reader(f) | |
for row in reader: | |
data.append((int(row[0]), float(row[1]))) | |
inflights = [r[0] for r in data] | |
latency = [r[1] for r in data] | |
def duh(l): | |
print('mean ' + str(statistics.mean(l))) | |
print('median ' + str(statistics.median(l))) | |
print('pstdev ' + str(statistics.pstdev(l))) | |
print('inflights') | |
duh(inflights) | |
print('latency') | |
duh(latency) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment