summaryrefslogtreecommitdiffstats
path: root/release/spectrolog.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xrelease/spectrolog.py114
1 files changed, 114 insertions, 0 deletions
diff --git a/release/spectrolog.py b/release/spectrolog.py
new file mode 100755
index 0000000..df08a12
--- /dev/null
+++ b/release/spectrolog.py
@@ -0,0 +1,114 @@
+#! /usr/bin/env python
+
+import sys
+import time
+import datetime
+import random
+
+DATE_FMT = "%a %b %d %H:%M:%S %Y"
+
+duration = [] + [80] * 10 + [100] * 10 + [40] * 10
+
+diter = iter(duration)
+
+DURATIONS = (
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 40,
+ 50,
+ 50,
+ 50,
+ 50,
+ 75,
+ 75,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+)
+
+DURATION_FUZZ = (
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -2,
+ -2,
+ -2
+)
+
+while True:
+ print ("[pid: 88186|app: 0|req: 5/19] 127.0.0.1 () {38 vars in 696 bytes} "
+ "[%s] POST /update_metrics => generated 47 bytes "
+ "in %s msecs (HTTP/1.1 200) 9 headers in 378 bytes (1 switches on core 60)" %
+ (datetime.datetime.utcnow().strftime(DATE_FMT),
+ random.choice(DURATIONS) + random.choice(DURATION_FUZZ)))
+ # diter.next()))
+ sys.stdout.flush()
+
+ time.sleep(0.01)