Commit 270d8aec authored by Victor Marmol's avatar Victor Marmol

Raise cAdvisor stats cache to 2m.

This used to be 60ns which was a bug from when we switched from number of stats to duration. Seems like the type was silently converted/ignored.
parent 0f22b6fc
...@@ -42,8 +42,8 @@ type cadvisorClient struct { ...@@ -42,8 +42,8 @@ type cadvisorClient struct {
var _ Interface = new(cadvisorClient) var _ Interface = new(cadvisorClient)
// TODO(vmarmol): Make configurable. // TODO(vmarmol): Make configurable.
// The number of stats to keep in memory. // The amount of time for which to keep stats in memory.
const statsToCache = 60 const statsCacheDuration = 2 * time.Minute
// Creates a cAdvisor and exports its API on the specified port if port > 0. // Creates a cAdvisor and exports its API on the specified port if port > 0.
func New(port uint) (Interface, error) { func New(port uint) (Interface, error) {
...@@ -53,7 +53,7 @@ func New(port uint) (Interface, error) { ...@@ -53,7 +53,7 @@ func New(port uint) (Interface, error) {
} }
// Create and start the cAdvisor container manager. // Create and start the cAdvisor container manager.
m, err := manager.New(memory.New(statsToCache, nil), sysFs) m, err := manager.New(memory.New(statsCacheDuration, nil), sysFs)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment