Improved compression ratio histogram (#1143)

* Updated compression ratio histogram to better cover the actual range

Signed-off-by: Joe Elliott <number101010@gmail.com>

* Guard against divide by 0

Signed-off-by: Joe Elliott <number101010@gmail.com>

* Removed temp test

Signed-off-by: Joe Elliott <number101010@gmail.com>
pull/1076/head^2
Joe Elliott 6 years ago committed by Robert Fratto
parent 7af0c2bdf3
commit 0f7f200c03
  1. 4
      pkg/ingester/flush.go

@ -44,7 +44,7 @@ var (
chunkCompressionRatio = promauto.NewHistogram(prometheus.HistogramOpts{
Name: "loki_ingester_chunk_compression_ratio",
Help: "Compression ratio of chunks (when stored).",
Buckets: prometheus.LinearBuckets(1, 1.5, 6),
Buckets: prometheus.LinearBuckets(.75, 2, 10),
})
chunksPerTenant = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "loki_ingester_chunks_stored_total",
@ -312,7 +312,7 @@ func (i *Ingester) flushChunks(ctx context.Context, fp model.Fingerprint, labelP
compressedSize := float64(len(byt))
uncompressedSize, ok := chunkenc.UncompressedSize(wc.Data)
if ok {
if ok && compressedSize > 0 {
chunkCompressionRatio.Observe(float64(uncompressedSize) / compressedSize)
}

Loading…
Cancel
Save