mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
b9868c9f0b
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
23 lines
350 B
Go
23 lines
350 B
Go
package tsdb
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"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
|
|
}
|
|
|
|
return nil, errors.New("Chunk with ref not found")
|
|
}
|
|
|
|
func (cr mockChunkReader) Close() error {
|
|
return nil
|
|
}
|