enable storage cache for influxdb

This commit is contained in:
Nan Deng 2014-08-08 11:17:30 -07:00
parent 9541787622
commit cd1422cfdb

View File

@ -21,6 +21,7 @@ import (
"time" "time"
"github.com/google/cadvisor/storage" "github.com/google/cadvisor/storage"
"github.com/google/cadvisor/storage/cache"
"github.com/google/cadvisor/storage/influxdb" "github.com/google/cadvisor/storage/influxdb"
"github.com/google/cadvisor/storage/memory" "github.com/google/cadvisor/storage/memory"
) )
@ -61,6 +62,7 @@ func NewStorageDriver(driverName string) (storage.StorageDriver, error) {
// TODO(monnand): One hour? Or user-defined? // TODO(monnand): One hour? Or user-defined?
1*time.Hour, 1*time.Hour,
) )
storageDriver = cache.MemoryCache(*argHistoryDuration, *argHistoryDuration, storageDriver)
default: default:
err = fmt.Errorf("Unknown database driver: %v", *argDbDriver) err = fmt.Errorf("Unknown database driver: %v", *argDbDriver)
} }