Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
search: Add max elapsed time per case in benchmark results
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaty committed Sep 22, 2021
1 parent feb54cd commit 64f4672
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pcapi/scripts/benchmark_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ def pretty_printed_criteria(self):
def is_slow(self):
return any(result_set.is_slow for result_set in self.results_per_backend)

@property
def max_elapsed(self):
return max(result_set.elapsed for result_set in self.results_per_backend)


@dataclasses.dataclass
class Benchmark:
Expand Down Expand Up @@ -491,6 +495,7 @@ def main():
<li>
<a href="#{{ case.html_anchor }}"
class="elapsed {% if case.is_slow %} slow-search{% endif %}">{{ case.description }}</a>
({{ "%.3f"|format(case.max_elapsed) }}s)
</li>
{% endfor %}
</ol>
Expand Down

0 comments on commit 64f4672

Please sign in to comment.