Skip to content

Commit

Permalink
target: parse bench metrics for all targets (including x86) and renam…
Browse files Browse the repository at this point in the history
…e Runtime [s] to End-to-End Runtime [s]
  • Loading branch information
PhilippvK committed Jul 22, 2024
1 parent 3e3b34e commit 18db8bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mlonmcu/target/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@


from mlonmcu.setup.utils import execute
from mlonmcu.target.bench import add_bench_metrics
from .metrics import Metrics


Expand Down Expand Up @@ -132,6 +133,9 @@ def parse_exit(self, out):
exit_code = int(exit_match.group(1))
return exit_code

def parse_stdout(self, out, metrics, exit_code=0):
add_bench_metrics(out, metrics, exit_code != 0, target_name=self.name)

def get_metrics(self, elf, directory, *args, handle_exit=None):
# This should not be accurate, just a fallback which should be overwritten
start_time = time.time()
Expand All @@ -157,7 +161,9 @@ def _handle_exit(code, out=None):
diff = end_time - start_time
# size instead of readelf?
metrics = Metrics()
metrics.add("Runtime [s]", diff)
metrics.add("End-to-End Runtime [s]", diff)
exit_code = 0 # TODO: get from handler?
self.parse_stdout(out, metrics, exit_code=exit_code)

return metrics, out, artifacts

Expand Down

0 comments on commit 18db8bf

Please sign in to comment.