summaryrefslogtreecommitdiffstats
path: root/release/spectrolog.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:55 +0000
commit5068d34c08f951a7ea6257d305a1627b09a95817 (patch)
tree08213e2be853396a3b07ce15dbe222644dcd9a89 /release/spectrolog.py
parentInitial commit. (diff)
downloadlnav-5068d34c08f951a7ea6257d305a1627b09a95817.tar.xz
lnav-5068d34c08f951a7ea6257d305a1627b09a95817.zip
Adding upstream version 0.11.1.upstream/0.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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)