Skip to content

Commit bd825cf

Browse files
committed
Improve run layout
1 parent df4e8ba commit bd825cf

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

dev/archery/archery/benchmark/runner.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
import datetime
1819
import glob
1920
import json
2021
import os
21-
import random
2222
import re
2323
import subprocess
2424

@@ -265,12 +265,15 @@ def from_rev_or_path(src, root, rev_or_path, cmake_conf, **kwargs):
265265
else:
266266
src_rev, _ = src.at_revision(rev_or_path, clone_dir)
267267
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")
269269
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")
271274
build_dir = os.path.join(run_root, run_id)
272275
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)
274277
os.makedirs(results_dir, exist_ok=True)
275278
return CppBenchmarkRunner(
276279
build, run_id=run_id, results_dir=results_dir, **kwargs

0 commit comments

Comments
 (0)