|
|
@ -15,6 +15,7 @@ package metric
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"os"
|
|
|
|
"sort"
|
|
|
|
"sort"
|
|
|
|
"sync"
|
|
|
|
"sync"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
@ -114,7 +115,9 @@ const watermarkCacheLimit = 1024 * 1024
|
|
|
|
|
|
|
|
|
|
|
|
func NewTieredStorage(appendToDiskQueueDepth, viewQueueDepth uint, flushMemoryInterval time.Duration, memoryTTL time.Duration, rootDirectory string) (*TieredStorage, error) {
|
|
|
|
func NewTieredStorage(appendToDiskQueueDepth, viewQueueDepth uint, flushMemoryInterval time.Duration, memoryTTL time.Duration, rootDirectory string) (*TieredStorage, error) {
|
|
|
|
if isDir, _ := utility.IsDir(rootDirectory); !isDir {
|
|
|
|
if isDir, _ := utility.IsDir(rootDirectory); !isDir {
|
|
|
|
return nil, fmt.Errorf("Could not find metrics directory %s", rootDirectory)
|
|
|
|
if err := os.MkdirAll(rootDirectory, 0755); err != nil {
|
|
|
|
|
|
|
|
return nil, fmt.Errorf("Could not find or create metrics directory %s: %s", rootDirectory, err)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
diskStorage, err := NewLevelDBMetricPersistence(rootDirectory)
|
|
|
|
diskStorage, err := NewLevelDBMetricPersistence(rootDirectory)
|
|
|
|