mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Test that approxBytesPerEntry const is correct
The comment on the constant mentions where it comes from, so we can actually check its value in that test. Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
This commit is contained in:
parent
62935a1241
commit
3dd18a1ece
|
@ -64,6 +64,7 @@ func TestSeriesHashCache_MeasureApproximateSizePerEntry(t *testing.T) {
|
||||||
runtime.ReadMemStats(&after)
|
runtime.ReadMemStats(&after)
|
||||||
|
|
||||||
t.Logf("approximate size per entry: %d bytes", (after.TotalAlloc-before.TotalAlloc)/numEntries)
|
t.Logf("approximate size per entry: %d bytes", (after.TotalAlloc-before.TotalAlloc)/numEntries)
|
||||||
|
require.Equal(t, uint64(approxBytesPerEntry), (after.TotalAlloc-before.TotalAlloc)/numEntries, "approxBytesPerEntry constant is out date")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSeriesHashCache_Concurrency(t *testing.T) {
|
func TestSeriesHashCache_Concurrency(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue