Merge pull request #3087 from prometheus/cut-beta2

vendor: update prometheus/tsdb
This commit is contained in:
Fabian Reinartz 2017-08-18 10:11:30 +02:00 committed by GitHub
commit 86e5c90061
2 changed files with 14 additions and 8 deletions

View file

@ -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
}
}

14
vendor/vendor.json vendored
View file

@ -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=",