This PR adds unit tests for `metrics::record`, based on the benchmarks for the same function. Currently, there is a test that fires a single response end event and asserts that the metrics state is correct afterward, and a test that fires all the events to simulate a full connection lifetime, and asserts that the metrics state is correct afterward. I'd like to also add a test that simulates multiple events with different labels, but I'll add that in a subsequent PR, In order to add these tests, it was necessary to to add test-only accessors to make some `metrics` structs `pub`` so that the test can access them. I also added some test-only functions to `metrics::Histogram`s, to make them easier to make assertions about. |
||
---|---|---|
.github | ||
proxy | ||
CONTRIBUTING.md | ||
Cargo.lock | ||
Cargo.toml | ||
DCO | ||
LICENSE |