From fd784cbca2dd908a3d66d71149574360a862d47e Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Tue, 9 Sep 2014 16:57:45 -0700 Subject: [PATCH] Remove memory storage driver and make empty the default. This fixes the current cAdvisor HEAD. --- cadvisor.go | 2 +- storagedriver.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cadvisor.go b/cadvisor.go index 84ae1544..fcf248ba 100644 --- a/cadvisor.go +++ b/cadvisor.go @@ -34,7 +34,7 @@ import ( 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 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: (default), bigquery, and influxdb") func main() { flag.Parse() diff --git a/storagedriver.go b/storagedriver.go index 0009e96a..ea0c94bb 100644 --- a/storagedriver.go +++ b/storagedriver.go @@ -49,6 +49,8 @@ func NewStorageDriver(driverName string) (*memory.InMemoryStorage, error) { samplesToCache = statsRequestedByUI } switch driverName { + case "": + backendStorage = nil case "influxdb": var hostname string hostname, err = os.Hostname() @@ -87,7 +89,7 @@ func NewStorageDriver(driverName string) (*memory.InMemoryStorage, error) { if err != nil { 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) return storageDriver, nil }