-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark.py
executable file
·81 lines (67 loc) · 1.93 KB
/
benchmark.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright (C) 2025 Huawei Technologies Co., Ltd. All rights reserved.
import pathlib
from typing import Any, Dict, List
from benchkit.benchmark import Benchmark
from benchkit.utils.dir import get_curdir, parentdir
class Benchamel(Benchmark):
def __init__(self, ) -> None:
super().__init__(
command_wrappers=(),
command_attachments=(),
shared_libs=(),
pre_run_hooks=(),
post_run_hooks=(),
)
script_path = get_curdir(__file__)
self._bench_src_path = script_path
self._build_dir = script_path / "build"
@property
def bench_src_path(self) -> pathlib.Path:
return self._bench_src_path
@staticmethod
def get_build_var_names() -> List[str]:
return [
'test',
]
@staticmethod
def get_run_var_names() -> List[str]:
return ['test']
@staticmethod
def get_tilt_var_names() -> List[str]:
return []
def prebuild_bench( # pylint: disable=arguments-differ
self,
benchmark_duration_seconds: int,
) -> None:
pass
def build_bench( # pylint: disable=arguments-differ
self,
test: str,
benchmark_duration_seconds: int,
**_kwargs,
) -> None:
pass
def clean_bench(self) -> None:
pass
def single_run(
self,
test: str,
**kwargs,
) -> str:
run_command = [test]
output = self.run_bench_command(
run_command=run_command,
wrapped_run_command=run_command,
current_dir=parentdir(test),
environment=None,
wrapped_environment=None,
print_output=True,
)
return output
def parse_output_to_results( # pylint: disable=arguments-differ
self,
command_output: str,
run_variables: Dict[str, Any],
**kwargs,
) -> Dict[str, Any]:
return {}