Skip to content

Commit f7631ef

Browse files
committed
Update plugin.py
1 parent fbcc3a9 commit f7631ef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

codeflash/benchmarking/plugin/plugin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def write_benchmark_timings(self) -> None:
5252
try:
5353
cur = self._connection.cursor()
5454
cur.executemany(
55-
"INSERT INTO benchmark_timings (benchmark_module_path, benchmark_function_name, benchmark_line_number, benchmark_time_ns) VALUES (?, ?, ?, ?)",
55+
"INSERT INTO benchmark_timings (benchmark_module_path, benchmark_function_name, benchmark_line_number, benchmark_time_ns) VALUES (?, ?, ?, ?)", # noqa: E501
5656
self.benchmark_timings,
5757
)
5858
self._connection.commit()
@@ -238,7 +238,7 @@ def _run_benchmark(
238238
Path(str(self.request.node.fspath)), Path(codeflash_benchmark_plugin.project_root)
239239
)
240240
benchmark_function_name = self.request.node.name
241-
line_number = int(str(sys._getframe(2).f_lineno)) # 2 frames up in the call stack
241+
line_number = int(str(sys._getframe(2).f_lineno)) # 2 frames up in the call stack # noqa: SLF001
242242
self._call_count += 1
243243
if benchmark_name_suffix:
244244
call_identifier = f"{benchmark_function_name}::{benchmark_name_suffix}"
@@ -260,7 +260,9 @@ def _run_benchmark(
260260
codeflash_benchmark_plugin.benchmark_timings.append(
261261
(benchmark_module_path, call_identifier, line_number, end - start)
262262
)
263-
263+
logger.info(
264+
f"Benchmarking {benchmark_module_path}::{call_identifier} took {(end - start) / 1_000_000:.2f} ms"
265+
)
264266
return result
265267

266268
@staticmethod

0 commit comments

Comments
 (0)