Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for cpuUsageCache (0.14 sec)

  1. pkg/kubelet/stats/cri_stats_provider.go

    func (p *criStatsProvider) cleanupOutdatedCaches() {
    	p.mutex.Lock()
    	defer p.mutex.Unlock()
    
    	for k, v := range p.cpuUsageCache {
    		if v == nil {
    			delete(p.cpuUsageCache, k)
    			continue
    		}
    
    		if time.Since(time.Unix(0, v.stats.Timestamp)) > defaultCachePeriod {
    			delete(p.cpuUsageCache, k)
    		}
    	}
    }
    
    // removeTerminatedPods returns pods with terminated ones removed.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 01 18:46:33 UTC 2023
    - 35.1K bytes
    - Viewed (0)
  2. pkg/kubelet/stats/cri_stats_provider_test.go

    	tests := []struct {
    		desc          string
    		cpuUsageCache map[string]*cpuUsageRecord
    		stats         *runtimeapi.ContainerStats
    		expected      *uint64
    	}{
    		{
    			desc:          "should return nil if stats is nil",
    			cpuUsageCache: map[string]*cpuUsageRecord{},
    		},
    		{
    			desc:          "should return nil if cpu stats is nil",
    			cpuUsageCache: map[string]*cpuUsageRecord{},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 14:24:16 UTC 2024
    - 54.5K bytes
    - Viewed (0)
Back to top