Make LevelDB chunk size a flag.

This commit is contained in:
Julius Volz 2013-03-12 10:20:16 -07:00 committed by Matt T. Proud
parent ce4f560e48
commit 8939e0723a
1 changed files with 4 additions and 3 deletions

View File

@ -32,8 +32,9 @@ import (
) )
var ( var (
maximumChunkSize = 200 leveldbChunkSize = flag.Int("leveldbChunkSize", 200, "Maximum number of samples stored under one key.")
sortConcurrency = 2
sortConcurrency = 2
) )
type LevelDBMetricPersistence struct { type LevelDBMetricPersistence struct {
@ -257,7 +258,7 @@ func (l *LevelDBMetricPersistence) AppendSamples(samples model.Samples) (err err
break break
} }
take := maximumChunkSize take := *leveldbChunkSize
if lengthOfGroup < take { if lengthOfGroup < take {
take = lengthOfGroup take = lengthOfGroup
} }