mirror of https://github.com/tstack/lnav
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
1.3 KiB
Python
114 lines
1.3 KiB
Python
8 years ago
|
#! /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),
|
||
|
diter.next()))
|
||
|
sys.stdout.flush()
|
||
|
|
||
|
time.sleep(0.25)
|