|
15 | 15 | # specific language governing permissions and limitations |
16 | 16 | # under the License. |
17 | 17 |
|
| 18 | +import datetime |
18 | 19 | import glob |
19 | 20 | import json |
20 | 21 | import os |
21 | | -import random |
22 | 22 | import re |
23 | 23 | import subprocess |
24 | 24 |
|
@@ -265,12 +265,15 @@ def from_rev_or_path(src, root, rev_or_path, cmake_conf, **kwargs): |
265 | 265 | else: |
266 | 266 | src_rev, _ = src.at_revision(rev_or_path, clone_dir) |
267 | 267 | cmake_def = CppCMakeDefinition(src_rev.cpp, cmake_conf) |
268 | | - run_root = os.path.join(root_rev, "build", "run") |
| 268 | + run_root = os.path.join(root_rev, "build") |
269 | 269 | os.makedirs(run_root, exist_ok=True) |
270 | | - run_id = f"{random.randrange(16**8):08x}" |
| 270 | + # run_id is a path-safe ISO-8601 UTC timestamp down to the second |
| 271 | + # so users get a brief idea of what run they are looking at. |
| 272 | + now = datetime.datetime.now(datetime.timezone.utc) |
| 273 | + run_id = now.strftime("%Y-%m-%dT%H-%M-%SZ") |
271 | 274 | build_dir = os.path.join(run_root, run_id) |
272 | 275 | build = cmake_def.build(build_dir) |
273 | | - results_dir = os.path.join(root_rev, "bench", "run", run_id) |
| 276 | + results_dir = os.path.join(root_rev, "bench", run_id) |
274 | 277 | os.makedirs(results_dir, exist_ok=True) |
275 | 278 | return CppBenchmarkRunner( |
276 | 279 | build, run_id=run_id, results_dir=results_dir, **kwargs |
|
0 commit comments