File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 18
18
PRODUCERS = PRODUCER_MAP .values ()
19
19
20
20
21
- def run (backend , api_key ):
21
+ def run (backend , api_key , speed_multiple ):
22
22
while True :
23
23
print ("Tick" )
24
24
@@ -42,12 +42,13 @@ def run(backend, api_key):
42
42
urljoin (backend , path ), json = body , headers = {"authorization" : api_key }
43
43
)
44
44
45
- time .sleep (tick_length .total_seconds ())
45
+ time .sleep (tick_length .total_seconds () / speed_multiple )
46
46
47
47
48
48
if __name__ == "__main__" :
49
49
parser = argparse .ArgumentParser ()
50
50
parser .add_argument ("-b" , "--metlo_backend" , required = True )
51
51
parser .add_argument ("-key" , "--api_key" , required = True )
52
+ parser .add_argument ("-s" , "--speed_multiple" , type = int , default = 1 )
52
53
args = parser .parse_args ()
53
- run (args .metlo_backend , args .api_key )
54
+ run (args .metlo_backend , args .api_key , args . speed_multiple )
Original file line number Diff line number Diff line change 13
13
}
14
14
15
15
16
+ sources = [(fake .ipv4 (), choice (range (10000 , 20000 ))) for e in range (100 )]
17
+
18
+
16
19
def get_meta ():
20
+ source = choice (sources )
17
21
return {
18
22
"environment" : "production" ,
19
23
"incoming" : True ,
20
- "source" : fake . ipv4 () ,
21
- "sourcePort" : choice ( range ( 10000 , 20000 )) ,
24
+ "source" : source [ 0 ] ,
25
+ "sourcePort" : source [ 1 ] ,
22
26
"destination" : "76.47.25.189" ,
23
27
"destinationPort" : 443 ,
24
28
}
You can’t perform that action at this time.
0 commit comments