forked from p34709852/monkey
More improvement on telemetry fabrication logging
This commit is contained in:
parent
41ae125980
commit
55d3fd5bd8
|
@ -32,4 +32,5 @@ To run telemetry performance test follow these steps:
|
||||||
1. Run `telem_parser.py` scrip with working directory set to `monkey\envs\monkey_zoo\blackbox`
|
1. Run `telem_parser.py` scrip with working directory set to `monkey\envs\monkey_zoo\blackbox`
|
||||||
2. Pass integer to indicate the multiplier. For example running `telem_parser.py 4` will replicate
|
2. Pass integer to indicate the multiplier. For example running `telem_parser.py 4` will replicate
|
||||||
telemetries 4 times.
|
telemetries 4 times.
|
||||||
|
3. If you're using pycharm check "Emulate terminal in output console" on debug/run configuraion.
|
||||||
3. Run blackbox tests, telemetry performance test will run as part of it.
|
3. Run blackbox tests, telemetry performance test will run as part of it.
|
||||||
|
|
|
@ -24,7 +24,7 @@ class TelemParser:
|
||||||
telems = TelemParser.get_all_telemetries()
|
telems = TelemParser.get_all_telemetries()
|
||||||
telem_contents = [json.loads(telem['content']) for telem in telems]
|
telem_contents = [json.loads(telem['content']) for telem in telems]
|
||||||
monkeys = self.get_monkeys_from_telems(telem_contents)
|
monkeys = self.get_monkeys_from_telems(telem_contents)
|
||||||
for i in tqdm(range(self.multiplier), desc="Batch of fabricated telemetries"):
|
for i in tqdm(range(self.multiplier), desc="Batch of fabricated telemetries", position=1):
|
||||||
for monkey in monkeys:
|
for monkey in monkeys:
|
||||||
monkey.change_fake_data()
|
monkey.change_fake_data()
|
||||||
fake_telem_batch = copy.deepcopy(telems)
|
fake_telem_batch = copy.deepcopy(telems)
|
||||||
|
@ -34,7 +34,7 @@ class TelemParser:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def fabricate_monkeys_in_telems(telems: List[Dict], monkeys: List[FakeMonkey]):
|
def fabricate_monkeys_in_telems(telems: List[Dict], monkeys: List[FakeMonkey]):
|
||||||
for telem in tqdm(telems, desc="Teletry"):
|
for telem in tqdm(telems, desc="Telemetries fabricated", position=2):
|
||||||
for monkey in monkeys:
|
for monkey in monkeys:
|
||||||
if monkey.on_island:
|
if monkey.on_island:
|
||||||
continue
|
continue
|
||||||
|
@ -51,7 +51,7 @@ class TelemParser:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def save_teletries_to_files(telems: List[Dict]):
|
def save_teletries_to_files(telems: List[Dict]):
|
||||||
for telem in telems:
|
for telem in (tqdm(telems, desc="Telemetries saved to files", position=3)):
|
||||||
TelemParser.save_telemetry_to_file(telem)
|
TelemParser.save_telemetry_to_file(telem)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue