Rename Gorilla into varbit

This commit is contained in:
beorn7 2016-03-23 16:30:41 +01:00
parent 4b574e8a61
commit 865d16f870
6 changed files with 248 additions and 230 deletions

View file

@ -143,7 +143,7 @@ func init() {
) )
cfg.fs.Var( cfg.fs.Var(
&local.DefaultChunkEncoding, "storage.local.chunk-encoding-version", &local.DefaultChunkEncoding, "storage.local.chunk-encoding-version",
"Which chunk encoding version to use for newly created chunks. Currently supported is 0 (delta encoding), 1 (double-delta encoding), and 2 (Gorilla-style encoding).", "Which chunk encoding version to use for newly created chunks. Currently supported is 0 (delta encoding), 1 (double-delta encoding), and 2 (double-delta encoding with variable bit-width).",
) )
// Index cache sizes. // Index cache sizes.
cfg.fs.IntVar( cfg.fs.IntVar(

View file

@ -47,7 +47,7 @@ func (ce *chunkEncoding) Set(s string) error {
case "1": case "1":
*ce = doubleDelta *ce = doubleDelta
case "2": case "2":
*ce = gorilla *ce = varbit
default: default:
return fmt.Errorf("invalid chunk encoding: %s", s) return fmt.Errorf("invalid chunk encoding: %s", s)
} }
@ -57,7 +57,7 @@ func (ce *chunkEncoding) Set(s string) error {
const ( const (
delta chunkEncoding = iota delta chunkEncoding = iota
doubleDelta doubleDelta
gorilla varbit
) )
// chunkDesc contains meta-data for a chunk. Pay special attention to the // chunkDesc contains meta-data for a chunk. Pay special attention to the
@ -370,8 +370,8 @@ func newChunkForEncoding(encoding chunkEncoding) (chunk, error) {
return newDeltaEncodedChunk(d1, d0, true, chunkLen), nil return newDeltaEncodedChunk(d1, d0, true, chunkLen), nil
case doubleDelta: case doubleDelta:
return newDoubleDeltaEncodedChunk(d1, d0, true, chunkLen), nil return newDoubleDeltaEncodedChunk(d1, d0, true, chunkLen), nil
case gorilla: case varbit:
return newGorillaChunk(gorillaZeroEncoding), nil return newVarbitChunk(varbitZeroEncoding), nil
default: default:
return nil, fmt.Errorf("unknown chunk encoding: %v", encoding) return nil, fmt.Errorf("unknown chunk encoding: %v", encoding)
} }

View file

@ -1410,6 +1410,10 @@ func BenchmarkAppendType1(b *testing.B) {
benchmarkAppend(b, 1) benchmarkAppend(b, 1)
} }
func BenchmarkAppendType2(b *testing.B) {
benchmarkAppend(b, 2)
}
// Append a large number of random samples and then check if we can get them out // Append a large number of random samples and then check if we can get them out
// of the storage alright. // of the storage alright.
func testFuzz(t *testing.T, encoding chunkEncoding) { func testFuzz(t *testing.T, encoding chunkEncoding) {

File diff suppressed because it is too large Load diff