Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.

Commit 63101a0

Browse files
committed
Remove the compression ratio metrics
Signed-off-by: Chris Marchbanks <[email protected]>
1 parent 5704d31 commit 63101a0

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

wal/wal.go

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,12 @@ type WAL struct {
169169
compress bool
170170
snappyBuf []byte
171171

172-
fsyncDuration prometheus.Summary
173-
pageFlushes prometheus.Counter
174-
pageCompletions prometheus.Counter
175-
truncateFail prometheus.Counter
176-
truncateTotal prometheus.Counter
177-
currentSegment prometheus.Gauge
178-
recordRawSize prometheus.Counter
179-
recordCompressedSize prometheus.Counter
172+
fsyncDuration prometheus.Summary
173+
pageFlushes prometheus.Counter
174+
pageCompletions prometheus.Counter
175+
truncateFail prometheus.Counter
176+
truncateTotal prometheus.Counter
177+
currentSegment prometheus.Gauge
180178
}
181179

182180
// New returns a new WAL over the given directory.
@@ -229,16 +227,8 @@ func NewSize(logger log.Logger, reg prometheus.Registerer, dir string, segmentSi
229227
Name: "prometheus_tsdb_wal_segment_current",
230228
Help: "WAL segment index that TSDB is currently writing to.",
231229
})
232-
w.recordRawSize = prometheus.NewCounter(prometheus.CounterOpts{
233-
Name: "prometheus_tsdb_wal_raw_record_bytes_total",
234-
Help: "The total number of bytes received by the WAL.",
235-
})
236-
w.recordCompressedSize = prometheus.NewCounter(prometheus.CounterOpts{
237-
Name: "prometheus_tsdb_wal_compressed_record_bytes_total",
238-
Help: "The total size of records after having been compressed.",
239-
})
240230
if reg != nil {
241-
reg.MustRegister(w.fsyncDuration, w.pageFlushes, w.pageCompletions, w.truncateFail, w.truncateTotal, w.currentSegment, w.recordRawSize, w.recordCompressedSize)
231+
reg.MustRegister(w.fsyncDuration, w.pageFlushes, w.pageCompletions, w.truncateFail, w.truncateTotal, w.currentSegment)
242232
}
243233

244234
_, j, err := w.Segments()
@@ -570,7 +560,6 @@ func (w *WAL) log(rec []byte, final bool) error {
570560
}
571561

572562
compressed := false
573-
w.recordRawSize.Add(float64(len(rec)))
574563
if w.compress && len(rec) > 0 {
575564
// The snappy library uses `len` to calculate if we need a new buffer.
576565
// In order to allocate as few buffers as possible make the length
@@ -582,7 +571,6 @@ func (w *WAL) log(rec []byte, final bool) error {
582571
compressed = true
583572
}
584573
}
585-
w.recordCompressedSize.Add(float64(len(rec)))
586574

587575
// Populate as many pages as necessary to fit the record.
588576
// Be careful to always do one pass to ensure we write zero-length records.

0 commit comments

Comments
 (0)