From 1c4b5c63ca9c4464ac3f1b07c7f1c07ad690f582 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 9 May 2025 11:17:21 +0200 Subject: invocation log: include seconds in directory name The directory name is designed to allow an easy rough sorting by time. This can also be used to identify the latest build for a specific user. However, users often run several builds in a single minute; therefore, increase time-stamp precission to include seconds as well. While still lexicographic and chronological order will disagree, at least for a single user it will be correct most of the times. --- doc/concepts/profiling.md | 4 ++-- src/other_tools/just_mr/launch.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/concepts/profiling.md b/doc/concepts/profiling.md index 4030b638..08bc04ef 100644 --- a/doc/concepts/profiling.md +++ b/doc/concepts/profiling.md @@ -184,8 +184,8 @@ a directory `//-` where the committed code base (via rc-file merging) whereas the general logging location can be specified in a user-specific or machine-specific way. - - `` is the UTC timestamp (year, moth, day, - hours, minutes) of the invocation and `` is a universally + - `` is the UTC timestamp (year, moth, day, + hours, minutes, seconds) of the invocation and `` is a universally unique id for that invocation (following RFC9562). The reason we prefix the UUID with a time stamp is allow a simple time-based collection and clean up of the log data. diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index dc861c11..7d2bdf25 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -284,7 +284,7 @@ auto CallJust(std::optional const& config_file, } std::string uuid = CreateUUID(); auto invocation_id = fmt::format( - "{:%Y-%m-%d-%H:%M}-{}", fmt::gmtime(invocation_time), uuid); + "{:%Y-%m-%d-%H:%M:%S}-{}", fmt::gmtime(invocation_time), uuid); dir = dir / invocation_id; if (FileSystemManager::CreateDirectoryExclusive(dir)) { if (invocation_log.invocation_msg) { -- cgit v1.2.3