mirror of
https://github.com/prometheus/prometheus
synced 2025-03-24 12:17:27 +00:00
Update benchmark test and comment
This commit is contained in:
parent
df88de5800
commit
1508149184
tsdb/record
@ -770,7 +770,7 @@ func (e *Encoder) HistogramSamples(histograms []RefHistogramSample, b []byte) ([
|
||||
EncodeHistogram(&buf, h.H)
|
||||
}
|
||||
|
||||
// Reset buffer if only custom bucket histograms existed in list of histogram samples
|
||||
// Reset buffer if only custom bucket histograms existed in list of histogram samples.
|
||||
if len(histograms) == len(customBucketHistograms) {
|
||||
buf.Reset()
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ func BenchmarkWAL_HistogramEncoding(b *testing.B) {
|
||||
for _, labelCount := range []int{0, 10, 50} {
|
||||
for _, histograms := range []int{10, 100, 1000} {
|
||||
for _, buckets := range []int{0, 1, 10, 100} {
|
||||
b.Run(fmt.Sprintf("%s labels=%d histograms=%d buckets=%d", maker.name, labelCount, histograms, buckets), func(b *testing.B) {
|
||||
b.Run(fmt.Sprintf("type=%s/labels=%d/histograms=%d/buckets=%d", maker.name, labelCount, histograms, buckets), func(b *testing.B) {
|
||||
resetCache()
|
||||
maker.init(labelCount, histograms, buckets)
|
||||
enc := Encoder{}
|
||||
@ -598,6 +598,7 @@ func BenchmarkWAL_HistogramEncoding(b *testing.B) {
|
||||
if len(leftOver) > 0 {
|
||||
enc.CustomBucketsHistogramSamples(leftOver, buf)
|
||||
}
|
||||
b.ReportMetric(float64(len(buf)), "recordBytes/ops")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user