From 768bf914e00f008bc833b87da7fdbdb55152df35 Mon Sep 17 00:00:00 2001 From: Cyril Tovena Date: Fri, 20 Dec 2019 15:56:27 -0500 Subject: [PATCH] Changes the encoding used for the benchmark in the store. (#1448) Signed-off-by: Cyril Tovena --- Makefile | 2 +- pkg/storage/hack/main.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f077cc5891..7e5648bdc6 100644 --- a/Makefile +++ b/Makefile @@ -505,7 +505,7 @@ endif benchmark-store: go run $(MOD_FLAG) ./pkg/storage/hack/main.go - go test $(MOD_FLAG) ./pkg/storage/ -bench=. -benchmem -memprofile memprofile.out -cpuprofile cpuprofile.out + go test $(MOD_FLAG) ./pkg/storage/ -bench=. -benchmem -memprofile memprofile.out -cpuprofile cpuprofile.out -trace trace.out # regenerate drone yaml drone: diff --git a/pkg/storage/hack/main.go b/pkg/storage/hack/main.go index db2909bc06..9075f6ff21 100644 --- a/pkg/storage/hack/main.go +++ b/pkg/storage/hack/main.go @@ -28,7 +28,7 @@ import ( var ( start = model.Time(1523750400000) ctx = user.InjectOrgID(context.Background(), "fake") - maxChunks = 600 // 600 chunks is 1.2bib of data enough to run benchmark + maxChunks = 1200 // 1200 chunks is 2gib ish of data enough to run benchmark ) // fill up the local filesystem store with 1gib of data to run benchmark @@ -96,7 +96,7 @@ func fillStore() error { labelsBuilder.Set(labels.MetricName, "logs") metric := labelsBuilder.Labels() fp := client.FastFingerprint(lbs) - chunkEnc := chunkenc.NewMemChunkSize(chunkenc.EncGZIP, 262144, 0) + chunkEnc := chunkenc.NewMemChunkSize(chunkenc.EncLZ4_64k, 262144, 1572864) for ts := start.UnixNano(); ts < start.UnixNano()+time.Hour.Nanoseconds(); ts = ts + time.Millisecond.Nanoseconds() { entry := &logproto.Entry{ Timestamp: time.Unix(0, ts), @@ -119,7 +119,7 @@ func fillStore() error { if flushCount >= maxChunks { return } - chunkEnc = chunkenc.NewMemChunkSize(chunkenc.EncGZIP, 262144, 0) + chunkEnc = chunkenc.NewMemChunkSize(chunkenc.EncLZ4_64k, 262144, 1572864) } }