Fix bug in influxdb storage driver initialization.

This commit is contained in:
Vishnu Kannan 2014-08-27 22:18:27 +00:00
parent 75953be19b
commit 1fea109997
2 changed files with 3 additions and 2 deletions

View File

@ -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)
}

View File

@ -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,
)