]> git.hungrycats.org Git - bees/commitdiff
progress: put a timestamp in the bottom row
authorZygo Blaxell <bees@furryterror.org>
Fri, 10 Jan 2025 14:12:35 +0000 (09:12 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sun, 12 Jan 2025 04:39:55 +0000 (23:39 -0500)
This records the time when the progress data was calculated, to help
indicate when the data might be very old.

While we're here, move "now" out of the loop so there's only one value.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees-roots.cc

index 92b525ffc7134fcadef2862ce1aa5a6a103d8476..6c470e9b07b72309273c451a0477ba959e41b05a 100644 (file)
@@ -1025,6 +1025,7 @@ BeesScanModeExtent::next_transid(const CrawlMap &crawl_map_unused)
        });
        const auto dash_fill = Table::Fill('-');
        eta.insert_row(1, vector<Table::Content>(eta.cols().size(), dash_fill));
+       const auto now = time(NULL);
        for (const auto &i : s_magic_crawl_map) {
                const auto &subvol = i.first;
                const auto &magic = i.second;
@@ -1064,7 +1065,6 @@ BeesScanModeExtent::next_transid(const CrawlMap &crawl_map_unused)
                }
                const auto bytenr_offset = min(bi_last_bytenr, max(bytenr, bi.first_bytenr)) - bi.first_bytenr + bi.first_total;
                const auto bytenr_norm = bytenr_offset / double(fs_size);
-               const auto now = time(NULL);
                const auto time_so_far = now - min(now, this_state.m_started);
                const string start_stamp = strf_localtime(this_state.m_started);
                string eta_stamp = "-";
@@ -1102,8 +1102,8 @@ BeesScanModeExtent::next_transid(const CrawlMap &crawl_map_unused)
                Table::Text("gen_now"),
                Table::Number(m_roots->transid_max()),
                Table::Text(""),
-               Table::Text(""),
-               Table::Text(""),
+               Table::Text("updated"),
+               Table::Text(strf_localtime(now)),
        });
        eta.left("");
        eta.mid(" ");