Skip to content

Commit

Permalink
fixup! Refactor persistence handling to use a factory pattern for bet…
Browse files Browse the repository at this point in the history
…ter flexibility and add local persistence option

Implement method overrides for persist_new_result in S3Persistence and LocalPersistence classes
  • Loading branch information
fabianliebig committed Nov 19, 2024
1 parent 56d97e7 commit 96d80d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions benchmarks/persistence/persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from attr import define, field
from attrs.validators import instance_of
from git import Repo
from typing_extensions import override

from benchmarks import Benchmark, Result

Expand Down Expand Up @@ -70,6 +71,7 @@ def _default_workflow_id(self) -> str:
raise ValueError("The environment variable GITHUB_RUN_ID is not set.")
return os.environ["GITHUB_RUN_ID"]

@override
def persist_new_result(self, result: Result, benchmark: Benchmark) -> None:
"""Store the result of a benchmark.
Expand Down Expand Up @@ -126,6 +128,7 @@ def _build_filename(self, result: Result) -> str:
+ f"{metadata.commit_hash}_results.json"
)

@override
def persist_new_result(self, result: Result, benchmark: Benchmark) -> None:
"""Store the result of a benchmark."""
filename = self._build_filename(result)
Expand Down

0 comments on commit 96d80d2

Please sign in to comment.