mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	change CounterVec to use Counter in the Kubelet's Pod Lifecycle Event Generator
This commit is contained in:
		@@ -165,17 +165,16 @@ var (
 | 
			
		||||
			StabilityLevel: metrics.ALPHA,
 | 
			
		||||
		},
 | 
			
		||||
	)
 | 
			
		||||
	// PLEGDiscardEvents is a Histogram that tracks the duration (in seconds) it takes for discarding events in the Kubelet's
 | 
			
		||||
	// Pod Lifecycle Event Generator (PLEG).
 | 
			
		||||
	PLEGDiscardEvents = metrics.NewCounterVec(
 | 
			
		||||
	// PLEGDiscardEvents is a Counter that tracks the number of discarding events in the Kubelet's Pod Lifecycle Event Generator (PLEG).
 | 
			
		||||
	PLEGDiscardEvents = metrics.NewCounter(
 | 
			
		||||
		&metrics.CounterOpts{
 | 
			
		||||
			Subsystem:      KubeletSubsystem,
 | 
			
		||||
			Name:           PLEGDiscardEventsKey,
 | 
			
		||||
			Help:           "The number of discard events in PLEG.",
 | 
			
		||||
			StabilityLevel: metrics.ALPHA,
 | 
			
		||||
		},
 | 
			
		||||
		[]string{},
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
	// PLEGRelistInterval is a Histogram that tracks the intervals (in seconds) between relisting in the Kubelet's
 | 
			
		||||
	// Pod Lifecycle Event Generator (PLEG).
 | 
			
		||||
	PLEGRelistInterval = metrics.NewHistogram(
 | 
			
		||||
 
 | 
			
		||||
@@ -272,7 +272,7 @@ func (g *GenericPLEG) relist() {
 | 
			
		||||
			select {
 | 
			
		||||
			case g.eventChannel <- events[i]:
 | 
			
		||||
			default:
 | 
			
		||||
				metrics.PLEGDiscardEvents.WithLabelValues().Inc()
 | 
			
		||||
				metrics.PLEGDiscardEvents.Inc()
 | 
			
		||||
				klog.Error("event channel is full, discard this relist() cycle event")
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user