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

Commit

Permalink
Remove the compression ratio metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
  • Loading branch information
csmarchbanks committed Jun 5, 2019
1 parent a836dd7 commit e1eba5f
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions wal/wal.go
Expand Up @@ -169,14 +169,12 @@ type WAL struct {
compress bool
snappyBuf []byte

fsyncDuration prometheus.Summary
pageFlushes prometheus.Counter
pageCompletions prometheus.Counter
truncateFail prometheus.Counter
truncateTotal prometheus.Counter
currentSegment prometheus.Gauge
recordRawSize prometheus.Counter
recordCompressedSize prometheus.Counter
fsyncDuration prometheus.Summary
pageFlushes prometheus.Counter
pageCompletions prometheus.Counter
truncateFail prometheus.Counter
truncateTotal prometheus.Counter
currentSegment prometheus.Gauge
}

// New returns a new WAL over the given directory.
Expand Down Expand Up @@ -229,16 +227,8 @@ func NewSize(logger log.Logger, reg prometheus.Registerer, dir string, segmentSi
Name: "prometheus_tsdb_wal_segment_current",
Help: "WAL segment index that TSDB is currently writing to.",
})
w.recordRawSize = prometheus.NewCounter(prometheus.CounterOpts{
Name: "prometheus_tsdb_wal_raw_record_bytes_total",
Help: "The total number of bytes received by the WAL.",
})
w.recordCompressedSize = prometheus.NewCounter(prometheus.CounterOpts{
Name: "prometheus_tsdb_wal_compressed_record_bytes_total",
Help: "The total size of records after having been compressed.",
})
if reg != nil {
reg.MustRegister(w.fsyncDuration, w.pageFlushes, w.pageCompletions, w.truncateFail, w.truncateTotal, w.currentSegment, w.recordRawSize, w.recordCompressedSize)
reg.MustRegister(w.fsyncDuration, w.pageFlushes, w.pageCompletions, w.truncateFail, w.truncateTotal, w.currentSegment)
}

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

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

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

0 comments on commit e1eba5f

Please sign in to comment.