Remove memory storage driver and make empty the default.

This fixes the current cAdvisor HEAD.
This commit is contained in:
Victor Marmol 2014-09-09 16:57:45 -07:00
parent 5200138f3e
commit fd784cbca2
2 changed files with 4 additions and 2 deletions

View File

@ -34,7 +34,7 @@ import (
var argPort = flag.Int("port", 8080, "port to listen") var argPort = flag.Int("port", 8080, "port to listen")
var maxProcs = flag.Int("max_procs", 0, "max number of CPUs that can be used simultaneously. Less than 1 for default (number of cores).") var maxProcs = flag.Int("max_procs", 0, "max number of CPUs that can be used simultaneously. Less than 1 for default (number of cores).")
var argDbDriver = flag.String("storage_driver", "memory", "storage driver to use. Options are: memory (default), bigquery, and influxdb") var argDbDriver = flag.String("storage_driver", "", "storage driver to use. Empty means none. Options are: <empty> (default), bigquery, and influxdb")
func main() { func main() {
flag.Parse() flag.Parse()

View File

@ -49,6 +49,8 @@ func NewStorageDriver(driverName string) (*memory.InMemoryStorage, error) {
samplesToCache = statsRequestedByUI samplesToCache = statsRequestedByUI
} }
switch driverName { switch driverName {
case "":
backendStorage = nil
case "influxdb": case "influxdb":
var hostname string var hostname string
hostname, err = os.Hostname() hostname, err = os.Hostname()
@ -87,7 +89,7 @@ func NewStorageDriver(driverName string) (*memory.InMemoryStorage, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
glog.Infof("Caching %d recent stats in memory; using %v storage driver\n", samplesToCache, driverName) glog.Infof("Caching %d recent stats in memory; using \"%v\" storage driver\n", samplesToCache, driverName)
storageDriver = memory.New(samplesToCache, samplesToCache, backendStorage) storageDriver = memory.New(samplesToCache, samplesToCache, backendStorage)
return storageDriver, nil return storageDriver, nil
} }