Skip to content

Commit

Permalink
fix: variable naming
Browse files Browse the repository at this point in the history
Signed-off-by: acejilam <acejilam@gmail.com>
  • Loading branch information
ls-2018 authored and dims committed Oct 16, 2023
1 parent 5638b0a commit 4dcb908
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const (
PodmanNamespace = "podman"
)

var HousekeepingConfigFlags = HouskeepingConfig{
var HousekeepingConfigFlags = HousekeepingConfig{
flag.Duration("max_housekeeping_interval", 60*time.Second, "Largest interval to allow between container housekeepings"),
flag.Bool("allow_dynamic_housekeeping", true, "Whether to allow the housekeeping interval to be dynamic"),
}
Expand Down Expand Up @@ -147,13 +147,13 @@ type Manager interface {
}

// Housekeeping configuration for the manager
type HouskeepingConfig = struct {
type HousekeepingConfig = struct {
Interval *time.Duration
AllowDynamic *bool
}

// New takes a memory storage and returns a new manager.
func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, houskeepingConfig HouskeepingConfig, includedMetricsSet container.MetricSet, collectorHTTPClient *http.Client, rawContainerCgroupPathPrefixWhiteList, containerEnvMetadataWhiteList []string, perfEventsFile string, resctrlInterval time.Duration) (Manager, error) {
func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, HousekeepingConfig HousekeepingConfig, includedMetricsSet container.MetricSet, collectorHTTPClient *http.Client, rawContainerCgroupPathPrefixWhiteList, containerEnvMetadataWhiteList []string, perfEventsFile string, resctrlInterval time.Duration) (Manager, error) {
if memoryCache == nil {
return nil, fmt.Errorf("manager requires memory storage")
}
Expand Down Expand Up @@ -200,8 +200,8 @@ func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, houskeepingConfig
cadvisorContainer: selfContainer,
inHostNamespace: inHostNamespace,
startupTime: time.Now(),
maxHousekeepingInterval: *houskeepingConfig.Interval,
allowDynamicHousekeeping: *houskeepingConfig.AllowDynamic,
maxHousekeepingInterval: *HousekeepingConfig.Interval,
allowDynamicHousekeeping: *HousekeepingConfig.AllowDynamic,
includedMetrics: includedMetricsSet,
containerWatchers: []watcher.ContainerWatcher{},
eventsChannel: eventsChannel,
Expand Down
2 changes: 1 addition & 1 deletion summary/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (s *StatsSummary) AddSample(stat v1.ContainerStats) error {
}
if elapsed > 60*time.Second {
// Make a minute sample. This works with dynamic housekeeping as long
// as we keep max dynamic houskeeping period close to a minute.
// as we keep max dynamic housekeeping period close to a minute.
minuteSample := GetMinutePercentiles(s.secondSamples)
// Clear seconds samples. Keep the latest sample for continuity.
// Copying and resizing helps avoid slice re-allocation.
Expand Down

0 comments on commit 4dcb908

Please sign in to comment.