1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Minimal process-wide counter for Statistics.db Table-of-Contents (TOC) walks
//! (issue #1658, epic #1606).
//!
//! Historically the metadata stack re-walked the Statistics.db TOC three times
//! during a single SSTable open — once to locate the `HEADER`
//! (SerializationHeader) offset and again inside
//! `repair_metadata::stats_component_bounds`, which `read_table_counts` and
//! `parse_stats_extras` each invoked while building `SSTableStatistics`. This
//! counter let the A5 cold-open bench (`benches/open.rs`) MEASURE that redundancy
//! so the fix could be scoped against a real number rather than a guess.
//!
//! As of issue #2148 the TOC is parsed ONCE
//! (`repair_metadata::parse_statistics_toc`, which resolves the HEADER offset and
//! the STATS bounds together) and threaded to the two downstream consumers via
//! their `*_with_toc` variants, so `toc_walk_count()` reads `1` per metadata
//! parse. It is NOT a decoding heuristic: nothing in the parse path reads the
//! count, so it has no effect on correctness (#28).
//!
//! The instrumentation is gated behind `cli-helpers` (roborev #1658): the
//! counter is only read by the cli-helpers-gated bench, so production builds
//! (default features) carry zero overhead — `record_toc_walk()` compiles to an
//! empty inline no-op.
/// Record that a Statistics.db TOC was walked once. Called at each TOC-walk site.
/// Gated behind cli-helpers so production builds carry zero overhead (roborev #1658).
pub
/// No-op in production builds (when cli-helpers is disabled).
pub
// The counter and its accessors are only compiled when cli-helpers is enabled
// (the bench that reads them is also gated on cli-helpers).
pub use ;
// When cli-helpers is disabled, provide stub functions so the bench module
// (which is itself gated on cli-helpers) still compiles if accidentally reached.