mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #19374 from timstclair/housekeep
Auto commit by PR queue bot
This commit is contained in:
commit
bf315d4563
@ -19,6 +19,7 @@ limitations under the License.
|
|||||||
package cadvisor
|
package cadvisor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
@ -46,8 +47,17 @@ var _ Interface = new(cadvisorClient)
|
|||||||
// The amount of time for which to keep stats in memory.
|
// The amount of time for which to keep stats in memory.
|
||||||
const statsCacheDuration = 2 * time.Minute
|
const statsCacheDuration = 2 * time.Minute
|
||||||
const maxHousekeepingInterval = 15 * time.Second
|
const maxHousekeepingInterval = 15 * time.Second
|
||||||
|
const defaultHousekeepingInterval = 10 * time.Second
|
||||||
const allowDynamicHousekeeping = true
|
const allowDynamicHousekeeping = true
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Override the default cAdvisor housekeeping interval.
|
||||||
|
if f := flag.Lookup("housekeeping_interval"); f != nil {
|
||||||
|
f.DefValue = defaultHousekeepingInterval.String()
|
||||||
|
f.Value.Set(f.DefValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 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) {
|
||||||
sysFs, err := sysfs.NewRealSysFs()
|
sysFs, err := sysfs.NewRealSysFs()
|
||||||
|
Loading…
Reference in New Issue
Block a user