package garbagecollector
import "k8s.io/kubernetes/pkg/controller/garbagecollector"
Index ¶
- Constants
- Variables
- func Register()
- type GarbageCollector
- func NewGarbageCollector(metaOnlyClientPool dynamic.ClientPool, clientPool dynamic.ClientPool, mapper meta.RESTMapper, deletableResources map[schema.GroupVersionResource]struct{}) (*GarbageCollector, error)
- func (gc *GarbageCollector) GraphHasUID(UIDs []types.UID) bool
- func (gc *GarbageCollector) HasSynced() bool
- func (gc *GarbageCollector) Run(workers int, stopCh <-chan struct{})
- type GraphBuilder
- type RegisteredRateLimiter
- type UIDCache
Constants ¶
const ( GarbageCollectSubsystem = "garbage_collector" EventProcessingLatencyKey = "event_processing_latency_microseconds" DirtyProcessingLatencyKey = "dirty_processing_latency_microseconds" OrphanProcessingLatencyKey = "orphan_processing_latency_microseconds" )
Variables ¶
var ( EventProcessingLatency = prometheus.NewSummary( prometheus.SummaryOpts{ Subsystem: GarbageCollectSubsystem, Name: EventProcessingLatencyKey, Help: "Time in microseconds of an event spend in the eventQueue", }, ) DirtyProcessingLatency = prometheus.NewSummary( prometheus.SummaryOpts{ Subsystem: GarbageCollectSubsystem, Name: DirtyProcessingLatencyKey, Help: "Time in microseconds of an item spend in the dirtyQueue", }, ) OrphanProcessingLatency = prometheus.NewSummary( prometheus.SummaryOpts{ Subsystem: GarbageCollectSubsystem, Name: OrphanProcessingLatencyKey, Help: "Time in microseconds of an item spend in the orphanQueue", }, ) )
Functions ¶
func Register ¶
func Register()
Register all metrics.
Types ¶
type GarbageCollector ¶
type GarbageCollector struct {
// contains filtered or unexported fields
}
GarbageCollector runs reflectors to watch for changes of managed API objects, funnels the results to a single-threaded dependencyGraphBuilder, which builds a graph caching the dependencies among objects. Triggered by the graph changes, the dependencyGraphBuilder enqueues objects that can potentially be garbage-collected to the `attemptToDelete` queue, and enqueues objects whose dependents need to be orphaned to the `attemptToOrphan` queue. The GarbageCollector has workers who consume these two queues, send requests to the API server to delete/update the objects accordingly. Note that having the dependencyGraphBuilder notify the garbage collector ensures that the garbage collector operates with a graph that is at least as up to date as the notification is sent.
func NewGarbageCollector ¶
func NewGarbageCollector(metaOnlyClientPool dynamic.ClientPool, clientPool dynamic.ClientPool, mapper meta.RESTMapper, deletableResources map[schema.GroupVersionResource]struct{}) (*GarbageCollector, error)
func (*GarbageCollector) GraphHasUID ¶
func (gc *GarbageCollector) GraphHasUID(UIDs []types.UID) bool
*FOR TEST USE ONLY* GraphHasUID returns if the GraphBuilder has a particular UID store in its uidToNode graph. It's useful for debugging. This method is used by integration tests.
func (*GarbageCollector) HasSynced ¶
func (gc *GarbageCollector) HasSynced() bool
func (*GarbageCollector) Run ¶
func (gc *GarbageCollector) Run(workers int, stopCh <-chan struct{})
type GraphBuilder ¶
type GraphBuilder struct {
// contains filtered or unexported fields
}
GraphBuilder: based on the events supplied by the informers, GraphBuilder updates uidToNode, a graph that caches the dependencies as we know, and enqueues items to the attemptToDelete and attemptToOrphan.
func (*GraphBuilder) HasSynced ¶
func (gb *GraphBuilder) HasSynced() bool
func (*GraphBuilder) Run ¶
func (gb *GraphBuilder) Run(stopCh <-chan struct{})
type RegisteredRateLimiter ¶
type RegisteredRateLimiter struct {
// contains filtered or unexported fields
}
RegisteredRateLimiter records the registered RateLimters to avoid duplication.
func NewRegisteredRateLimiter ¶
func NewRegisteredRateLimiter(resources map[schema.GroupVersionResource]struct{}) *RegisteredRateLimiter
NewRegisteredRateLimiter returns a new RegisteredRateLimiater. TODO: NewRegisteredRateLimiter is not dynamic. We need to find a better way when GC dynamically change the resources it monitors.
type UIDCache ¶
type UIDCache struct {
// contains filtered or unexported fields
}
UIDCache is an LRU cache for uid.
func NewUIDCache ¶
NewUIDCache returns a UIDCache.
func (*UIDCache) Add ¶
Add adds a uid to the cache.
func (*UIDCache) Has ¶
Has returns if a uid is in the cache.
Source Files ¶
errors.go garbagecollector.go graph.go graph_builder.go metrics.go operations.go patch.go rate_limiter_helper.go uid_cache.go
Directories ¶
Path | Synopsis |
---|---|
pkg/controller/garbagecollector/metaonly |
- Version
- v1.6.5-beta.0
- Published
- May 15, 2017
- Platform
- js/wasm
- Imports
- 30 packages
- Last checked
- 2 minutes ago –
Tools for package owners.