Skip to content

Commit 8cd9c0d

Browse files
committed
measure test discovery time
1 parent 9e0aa9c commit 8cd9c0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

codeflash/optimization/optimizer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import ast
44
import os
5+
import time
56
import shutil
67
import tempfile
78
from pathlib import Path
@@ -94,10 +95,11 @@ def run(self) -> None:
9495
return
9596

9697
console.rule()
98+
start_time = time.time()
9799
function_to_tests: dict[str, list[FunctionCalledInTest]] = discover_unit_tests(self.test_cfg)
98100
num_discovered_tests: int = sum([len(value) for value in function_to_tests.values()])
99101
console.rule()
100-
logger.info(f"Discovered {num_discovered_tests} existing unit tests in {self.test_cfg.tests_root}")
102+
logger.info(f"Discovered {num_discovered_tests} existing unit tests in {time.time() - start_time}s at {self.test_cfg.tests_root}")
101103
console.rule()
102104
ph("cli-optimize-discovered-tests", {"num_tests": num_discovered_tests})
103105

0 commit comments

Comments
 (0)