diff --git a/storage/cache/memcache.go b/storage/cache/memcache.go index e3848984..a0fed663 100644 --- a/storage/cache/memcache.go +++ b/storage/cache/memcache.go @@ -46,6 +46,7 @@ func (self *cachedStorageDriver) RecentStats(containerName string, numStats int) return self.backend.RecentStats(containerName, numStats) } +// TODO(vishh): Calculate percentiles from cached stats instead of reaching the DB. This will make the UI truly independent of the backend storage. func (self *cachedStorageDriver) Percentiles(containerName string, cpuUsagePercentiles []int, memUsagePercentiles []int) (*info.ContainerStatsPercentiles, error) { return self.backend.Percentiles(containerName, cpuUsagePercentiles, memUsagePercentiles) } diff --git a/storagedriver.go b/storagedriver.go index bd889680..a4543b5a 100644 --- a/storagedriver.go +++ b/storagedriver.go @@ -35,7 +35,7 @@ var argDbPassword = flag.String("storage_driver_password", "root", "database pas var argDbHost = flag.String("storage_driver_host", "localhost:8086", "database host:port") var argDbName = flag.String("storage_driver_db", "cadvisor", "database name") var argDbIsSecure = flag.Bool("storage_driver_secure", false, "use secure connection with database") -var argDbBufferDuration = flag.Duration("storage_driver_buffer_duration", 60*time.Second, "Writes in the storage driver will be bufferd for this duration, and committed to the non memory backends as a single transaction") +var argDbBufferDuration = flag.Duration("storage_driver_buffer_duration", 60*time.Second, "Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction") const statsRequestedByUI = 60 @@ -69,7 +69,7 @@ func NewStorageDriver(driverName string) (storage.StorageDriver, error) { *argDbPassword, *argDbHost, *argDbIsSecure, - *argDbBufferDuration*time.Second, + *argDbBufferDuration, // TODO(monnand): One hour? Or user-defined? 1*time.Hour, )