From 24b246ac28cc854e09d34690c130528946191f83 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Fri, 18 Aug 2017 10:08:59 +0200 Subject: [PATCH] vendor: update prometheus/tsdb --- vendor/github.com/prometheus/tsdb/compact.go | 8 +++++++- vendor/vendor.json | 14 +++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/vendor/github.com/prometheus/tsdb/compact.go b/vendor/github.com/prometheus/tsdb/compact.go index 3860509d8..dc803ef8f 100644 --- a/vendor/github.com/prometheus/tsdb/compact.go +++ b/vendor/github.com/prometheus/tsdb/compact.go @@ -98,11 +98,13 @@ func newCompactorMetrics(r prometheus.Registerer) *compactorMetrics { return m } +// LeveledCompactorOptions are the options for a LeveledCompactor. type LeveledCompactorOptions struct { blockRanges []int64 chunkPool chunks.Pool } +// NewLeveledCompactor returns a LeveledCompactor. func NewLeveledCompactor(r prometheus.Registerer, l log.Logger, opts *LeveledCompactorOptions) *LeveledCompactor { if opts == nil { opts = &LeveledCompactorOptions{ @@ -151,6 +153,10 @@ func (c *LeveledCompactor) Plan(dir string) ([]string, error) { return dms[i].meta.MinTime < dms[j].meta.MinTime }) + return c.plan(dms) +} + +func (c *LeveledCompactor) plan(dms []dirMeta) ([]string, error) { if len(dms) <= 1 { return nil, nil } @@ -170,7 +176,7 @@ func (c *LeveledCompactor) Plan(dir string) ([]string, error) { break } - if meta.Stats.NumSeries/meta.Stats.NumTombstones <= 20 { // 5% + if meta.Stats.NumSeries/(meta.Stats.NumTombstones+1) <= 20 { // 5% return []string{dms[i].dir}, nil } } diff --git a/vendor/vendor.json b/vendor/vendor.json index e831d1cf2..55e0b9e50 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -853,22 +853,22 @@ "revisionTime": "2016-04-11T19:08:41Z" }, { - "checksumSHA1": "x7qome5K8QtwLWlHQDsR0ISrp48=", + "checksumSHA1": "WvgmP/a6PVjj33/h8L7XrNUmoQE=", "path": "github.com/prometheus/tsdb", - "revision": "e0aca4bee9ae472d1c164c5562eed2a4bf4c700a", - "revisionTime": "2017-08-11T10:42:10Z" + "revision": "c4ca881685ae1266a75caf57da46d8b6934213c0", + "revisionTime": "2017-08-18T07:54:27Z" }, { "checksumSHA1": "Gua979gmISm4cJP/fR2hL8m5To8=", "path": "github.com/prometheus/tsdb/chunks", - "revision": "e0aca4bee9ae472d1c164c5562eed2a4bf4c700a", - "revisionTime": "2017-08-11T10:42:10Z" + "revision": "c4ca881685ae1266a75caf57da46d8b6934213c0", + "revisionTime": "2017-08-18T07:54:27Z" }, { "checksumSHA1": "zhmlvc322RH1L3l9DaA9d/HVVWs=", "path": "github.com/prometheus/tsdb/labels", - "revision": "e0aca4bee9ae472d1c164c5562eed2a4bf4c700a", - "revisionTime": "2017-08-11T10:42:10Z" + "revision": "c4ca881685ae1266a75caf57da46d8b6934213c0", + "revisionTime": "2017-08-18T07:54:27Z" }, { "checksumSHA1": "5SYLEhADhdBVZAGPVHWggQl7H8k=",