pub fn with_capturing_test_client(f: impl FnOnce()) -> Vec<String>Expand description
Runs f with a thread-local mock recorder installed, then returns all
captured metrics as "name:value|type|#key:value,key:value" strings.
Only affects the calling thread — safe for use in parallel tests.
§Example
ⓘ
let captured = objectstore_metrics::with_capturing_test_client(|| {
objectstore_metrics::counter!("test.counter": 1, "tag" => "val");
});
assert!(captured.iter().any(|m| m.starts_with("test.counter:")));