|
|
|
@ -21,12 +21,12 @@ package local
|
|
|
|
|
import ( |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"github.com/prometheus/prometheus/utility/test" |
|
|
|
|
"github.com/prometheus/prometheus/pkg/testutil" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
type testStorageCloser struct { |
|
|
|
|
storage Storage |
|
|
|
|
directory test.Closer |
|
|
|
|
directory testutil.Closer |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (t *testStorageCloser) Close() { |
|
|
|
@ -37,9 +37,9 @@ func (t *testStorageCloser) Close() {
|
|
|
|
|
// NewTestStorage creates a storage instance backed by files in a temporary
|
|
|
|
|
// directory. The returned storage is already in serving state. Upon closing the
|
|
|
|
|
// returned test.Closer, the temporary directory is cleaned up.
|
|
|
|
|
func NewTestStorage(t test.T, encoding chunkEncoding) (*memorySeriesStorage, test.Closer) { |
|
|
|
|
func NewTestStorage(t testutil.T, encoding chunkEncoding) (*memorySeriesStorage, testutil.Closer) { |
|
|
|
|
*defaultChunkEncoding = int(encoding) |
|
|
|
|
directory := test.NewTemporaryDirectory("test_storage", t) |
|
|
|
|
directory := testutil.NewTemporaryDirectory("test_storage", t) |
|
|
|
|
o := &MemorySeriesStorageOptions{ |
|
|
|
|
MemoryChunks: 1000000, |
|
|
|
|
MaxChunksToPersist: 1000000, |
|
|
|
|