mirror of
https://github.com/prometheus/prometheus
synced 2025-01-20 06:30:50 +00:00
Fix WAL tests
This commit is contained in:
parent
e006bc6dc6
commit
2f02f86b62
26
wal_test.go
26
wal_test.go
@ -32,16 +32,16 @@ func BenchmarkWALWrite(b *testing.B) {
|
||||
require.NoError(b, err)
|
||||
|
||||
var (
|
||||
samples [][]hashedSample
|
||||
samples [][]refdSample
|
||||
ts int64
|
||||
)
|
||||
for i := 0; i < 300; i++ {
|
||||
ts += int64(30000)
|
||||
scrape := make([]hashedSample, 0, len(series))
|
||||
scrape := make([]refdSample, 0, len(series))
|
||||
|
||||
for ref := range series {
|
||||
scrape = append(scrape, hashedSample{
|
||||
ref: uint32(ref),
|
||||
scrape = append(scrape, refdSample{
|
||||
ref: uint64(ref),
|
||||
t: ts,
|
||||
v: 12345788,
|
||||
})
|
||||
@ -83,16 +83,16 @@ func BenchmarkWALRead(b *testing.B) {
|
||||
require.NoError(b, err)
|
||||
|
||||
var (
|
||||
samples [][]hashedSample
|
||||
samples [][]refdSample
|
||||
ts int64
|
||||
)
|
||||
for i := 0; i < 300; i++ {
|
||||
ts += int64(30000)
|
||||
scrape := make([]hashedSample, 0, len(bseries))
|
||||
scrape := make([]refdSample, 0, len(bseries))
|
||||
|
||||
for ref := range bseries {
|
||||
scrape = append(scrape, hashedSample{
|
||||
ref: uint32(ref),
|
||||
scrape = append(scrape, refdSample{
|
||||
ref: uint64(ref),
|
||||
t: ts,
|
||||
v: 12345788,
|
||||
})
|
||||
@ -119,7 +119,7 @@ func BenchmarkWALRead(b *testing.B) {
|
||||
|
||||
err = wal.ReadAll(&walHandler{
|
||||
series: func(lset labels.Labels) { numSeries++ },
|
||||
sample: func(smpl hashedSample) { numSamples++ },
|
||||
sample: func(smpl refdSample) { numSamples++ },
|
||||
})
|
||||
require.NoError(b, err)
|
||||
|
||||
@ -149,16 +149,16 @@ func BenchmarkWALReadIntoHead(b *testing.B) {
|
||||
require.NoError(b, err)
|
||||
|
||||
var (
|
||||
samples [][]hashedSample
|
||||
samples [][]refdSample
|
||||
ts int64
|
||||
)
|
||||
for i := 0; i < 300; i++ {
|
||||
ts += int64(30000)
|
||||
scrape := make([]hashedSample, 0, len(bseries))
|
||||
scrape := make([]refdSample, 0, len(bseries))
|
||||
|
||||
for ref := range bseries {
|
||||
scrape = append(scrape, hashedSample{
|
||||
ref: uint32(ref),
|
||||
scrape = append(scrape, refdSample{
|
||||
ref: uint64(ref),
|
||||
t: ts,
|
||||
v: 12345788,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user