Skip to content

Commit

Permalink
fix logging info
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 committed Nov 12, 2023
1 parent a29a9fb commit 8800fc8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/benchmark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ class BenchmarkRunner:
def format_times_from_counter(counter: collections.Counter[str], top: int = 5) -> str:
return "\n".join(f" {time:.4f} in {name}" for name, time in counter.most_common(top))

def location_test(self, test_location: Location, state: CollectionState) -> float:
def location_test(self, test_location: Location, state: CollectionState, state_name: str) -> float:
with TimeIt(f"{test_location.game} {self.rule_iterations} "
f"runs of {test_location}.access_rule(empty_state)", logger) as t:
f"runs of {test_location}.access_rule({state_name})", logger) as t:
for _ in range(self.rule_iterations):
test_location.access_rule(state)
# if time is taken to disentangle complex ref chains,
Expand Down Expand Up @@ -103,10 +103,10 @@ def main(self):
continue

for location in locations:
time_taken = self.location_test(location, multiworld.state)
time_taken = self.location_test(location, multiworld.state, "empty_state")
summary_data["empty_state"][location.name] = time_taken

time_taken = self.location_test(location, all_state)
time_taken = self.location_test(location, all_state, "all_state")
summary_data["all_state"][location.name] = time_taken

total_empty_state = sum(summary_data["empty_state"].values())
Expand Down

0 comments on commit 8800fc8

Please sign in to comment.