diff --git a/main.go b/main.go index b178f2dfe..3a6155fc9 100644 --- a/main.go +++ b/main.go @@ -187,7 +187,7 @@ func main() { log.Fatalf("Error loading configuration from %s: %v", *configFile, err) } - ts, err := metric.NewTieredStorage(uint(*diskAppendQueueCapacity), 100, time.Second*30, time.Second*1, time.Second*20, *metricsStoragePath) + ts, err := metric.NewTieredStorage(uint(*diskAppendQueueCapacity), 100, time.Second*30, time.Second*20, *metricsStoragePath) if err != nil { log.Fatalf("Error opening storage: %s", err) } diff --git a/rules/rules_test.go b/rules/rules_test.go index c7a69af61..601a41acf 100644 --- a/rules/rules_test.go +++ b/rules/rules_test.go @@ -64,7 +64,7 @@ func (t testTieredStorageCloser) Close() { func NewTestTieredStorage(t test.Tester) (storage *metric.TieredStorage, closer test.Closer) { var directory test.TemporaryDirectory directory = test.NewTemporaryDirectory("test_tiered_storage", t) - storage, err := metric.NewTieredStorage(2500, 1000, 5*time.Second, 15*time.Second, 0*time.Second, directory.Path()) + storage, err := metric.NewTieredStorage(2500, 1000, 5*time.Second, 0*time.Second, directory.Path()) if err != nil { if storage != nil { diff --git a/storage/metric/helpers_test.go b/storage/metric/helpers_test.go index f272e55a0..023e782b6 100644 --- a/storage/metric/helpers_test.go +++ b/storage/metric/helpers_test.go @@ -86,7 +86,7 @@ func (t testTieredStorageCloser) Close() { func NewTestTieredStorage(t test.Tester) (storage *TieredStorage, closer test.Closer) { var directory test.TemporaryDirectory directory = test.NewTemporaryDirectory("test_tiered_storage", t) - storage, err := NewTieredStorage(2500, 1000, 5*time.Second, 15*time.Second, 0*time.Second, directory.Path()) + storage, err := NewTieredStorage(2500, 1000, 5*time.Second, 0*time.Second, directory.Path()) if err != nil { if storage != nil { diff --git a/storage/metric/tiered.go b/storage/metric/tiered.go index 55b96591f..3220fa644 100644 --- a/storage/metric/tiered.go +++ b/storage/metric/tiered.go @@ -64,7 +64,6 @@ type TieredStorage struct { memoryArena memorySeriesStorage memoryTTL time.Duration flushMemoryInterval time.Duration - writeMemoryInterval time.Duration // This mutex manages any concurrent reads/writes of the memoryArena. memoryMutex sync.RWMutex @@ -88,7 +87,7 @@ type viewJob struct { err chan error } -func NewTieredStorage(appendToDiskQueueDepth, viewQueueDepth uint, flushMemoryInterval, writeMemoryInterval, memoryTTL time.Duration, root string) (storage *TieredStorage, err error) { +func NewTieredStorage(appendToDiskQueueDepth, viewQueueDepth uint, flushMemoryInterval, memoryTTL time.Duration, root string) (storage *TieredStorage, err error) { diskStorage, err := NewLevelDBMetricPersistence(root) if err != nil { return @@ -102,7 +101,6 @@ func NewTieredStorage(appendToDiskQueueDepth, viewQueueDepth uint, flushMemoryIn memoryArena: NewMemorySeriesStorage(), memoryTTL: memoryTTL, viewQueue: make(chan viewJob, viewQueueDepth), - writeMemoryInterval: writeMemoryInterval, } return } @@ -185,8 +183,6 @@ func (t *TieredStorage) rebuildDiskFrontier(i leveldb.Iterator) (err error) { func (t *TieredStorage) Serve() { flushMemoryTicker := time.NewTicker(t.flushMemoryInterval) defer flushMemoryTicker.Stop() - writeMemoryTicker := time.NewTicker(t.writeMemoryInterval) - defer writeMemoryTicker.Stop() queueReportTicker := time.NewTicker(time.Second) defer queueReportTicker.Stop()