mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Changed approxBytesPerEntry after upgrading to golang 1.21
Signed-off-by: Marco Pracucci <marco@pracucci.com>
This commit is contained in:
parent
7c8e9a2a76
commit
397179e394
|
@ -13,7 +13,7 @@ const (
|
||||||
|
|
||||||
// approxBytesPerEntry is the estimated memory footprint (in bytes) of 1 cache
|
// approxBytesPerEntry is the estimated memory footprint (in bytes) of 1 cache
|
||||||
// entry, measured with TestSeriesHashCache_MeasureApproximateSizePerEntry().
|
// entry, measured with TestSeriesHashCache_MeasureApproximateSizePerEntry().
|
||||||
approxBytesPerEntry = 28
|
approxBytesPerEntry = 50
|
||||||
)
|
)
|
||||||
|
|
||||||
// SeriesHashCache is a bounded cache mapping the per-block series ID with
|
// SeriesHashCache is a bounded cache mapping the per-block series ID with
|
||||||
|
|
|
@ -66,7 +66,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")
|
require.Equal(t, approxBytesPerEntry, int((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