2017-03-07 03:47:49 -08:00
|
|
|
package tsdb
|
|
|
|
|
2017-04-13 07:27:31 -07:00
|
|
|
import (
|
|
|
|
"errors"
|
2017-03-07 03:47:49 -08:00
|
|
|
|
2017-04-13 07:27:31 -07:00
|
|
|
"github.com/prometheus/tsdb/chunks"
|
|
|
|
)
|
|
|
|
|
|
|
|
type mockChunkReader map[uint64]chunks.Chunk
|
|
|
|
|
|
|
|
func (cr mockChunkReader) Chunk(ref uint64) (chunks.Chunk, error) {
|
|
|
|
chk, ok := cr[ref]
|
|
|
|
if ok {
|
|
|
|
return chk, nil
|
|
|
|
}
|
2017-03-07 03:47:49 -08:00
|
|
|
|
2017-04-13 07:27:31 -07:00
|
|
|
return nil, errors.New("Chunk with ref not found")
|
2017-03-07 03:47:49 -08:00
|
|
|
}
|
|
|
|
|
2017-04-13 07:27:31 -07:00
|
|
|
func (cr mockChunkReader) Close() error {
|
|
|
|
return nil
|
2017-03-07 03:47:49 -08:00
|
|
|
}
|