kubernetes: k8s.io/kubernetes/pkg/controller/endpointslice/metrics Index | Files

package metrics

import "k8s.io/kubernetes/pkg/controller/endpointslice/metrics"

Index

Package Files

cache.go metrics.go

Constants

const EndpointSliceSubsystem = "endpoint_slice_controller"

EndpointSliceSubsystem - subsystem name used for Endpoint Slices.

Variables

var (
    // EndpointsAddedPerSync tracks the number of endpoints added on each
    // Service sync.
    EndpointsAddedPerSync = metrics.NewHistogramVec(
        &metrics.HistogramOpts{
            Subsystem:      EndpointSliceSubsystem,
            Name:           "endpoints_added_per_sync",
            Help:           "Number of endpoints added on each Service sync",
            StabilityLevel: metrics.ALPHA,
            Buckets:        metrics.ExponentialBuckets(2, 2, 15),
        },
        []string{},
    )
    // EndpointsRemovedPerSync tracks the number of endpoints removed on each
    // Service sync.
    EndpointsRemovedPerSync = metrics.NewHistogramVec(
        &metrics.HistogramOpts{
            Subsystem:      EndpointSliceSubsystem,
            Name:           "endpoints_removed_per_sync",
            Help:           "Number of endpoints removed on each Service sync",
            StabilityLevel: metrics.ALPHA,
            Buckets:        metrics.ExponentialBuckets(2, 2, 15),
        },
        []string{},
    )
    // EndpointsDesired tracks the total number of desired endpoints.
    EndpointsDesired = metrics.NewGaugeVec(
        &metrics.GaugeOpts{
            Subsystem:      EndpointSliceSubsystem,
            Name:           "endpoints_desired",
            Help:           "Number of endpoints desired",
            StabilityLevel: metrics.ALPHA,
        },
        []string{},
    )
    // NumEndpointSlices tracks the number of EndpointSlices in a cluster.
    NumEndpointSlices = metrics.NewGaugeVec(
        &metrics.GaugeOpts{
            Subsystem:      EndpointSliceSubsystem,
            Name:           "num_endpoint_slices",
            Help:           "Number of EndpointSlices",
            StabilityLevel: metrics.ALPHA,
        },
        []string{},
    )
    // DesiredEndpointSlices tracks the number of EndpointSlices that would
    // exist with perfect endpoint allocation.
    DesiredEndpointSlices = metrics.NewGaugeVec(
        &metrics.GaugeOpts{
            Subsystem:      EndpointSliceSubsystem,
            Name:           "desired_endpoint_slices",
            Help:           "Number of EndpointSlices that would exist with perfect endpoint allocation",
            StabilityLevel: metrics.ALPHA,
        },
        []string{},
    )

    // EndpointSliceChanges tracks the number of changes to Endpoint Slices.
    EndpointSliceChanges = metrics.NewCounterVec(
        &metrics.CounterOpts{
            Subsystem:      EndpointSliceSubsystem,
            Name:           "changes",
            Help:           "Number of EndpointSlice changes",
            StabilityLevel: metrics.ALPHA,
        },
        []string{"operation"},
    )
)

func RegisterMetrics Uses

func RegisterMetrics()

RegisterMetrics registers EndpointSlice metrics.

type Cache Uses

type Cache struct {
    // contains filtered or unexported fields
}

Cache tracks values for total numbers of desired endpoints as well as the efficiency of EndpointSlice endpoints distribution.

func NewCache Uses

func NewCache(endpointsPerSlice int32) *Cache

NewCache returns a new Cache with the specified endpointsPerSlice.

func (*Cache) DeleteService Uses

func (c *Cache) DeleteService(serviceNN types.NamespacedName)

DeleteService removes references of a Service from the global cache and updates the corresponding metrics.

func (*Cache) UpdateServicePortCache Uses

func (c *Cache) UpdateServicePortCache(serviceNN types.NamespacedName, spCache *ServicePortCache)

UpdateServicePortCache updates a ServicePortCache in the global cache for a given Service and updates the corresponding metrics. Parameters: * serviceNN refers to a NamespacedName representing the Service. * spCache refers to a ServicePortCache for the specified Service.

type EfficiencyInfo Uses

type EfficiencyInfo struct {
    Endpoints int
    Slices    int
}

EfficiencyInfo stores the number of Endpoints and Slices for calculating total numbers of desired endpoints and the efficiency of EndpointSlice endpoints distribution.

type ServicePortCache Uses

type ServicePortCache struct {
    // contains filtered or unexported fields
}

ServicePortCache tracks values for total numbers of desired endpoints as well as the efficiency of EndpointSlice endpoints distribution for each unique Service Port combination.

func NewServicePortCache Uses

func NewServicePortCache() *ServicePortCache

NewServicePortCache initializes and returns a new ServicePortCache.

func (*ServicePortCache) Set Uses

func (spc *ServicePortCache) Set(pmKey endpointutil.PortMapKey, eInfo EfficiencyInfo)

Set updates the ServicePortCache to contain the provided EfficiencyInfo for the provided PortMapKey.

Package metrics imports 6 packages (graph) and is imported by 1 packages. Updated 2019-11-15. Refresh now. Tools for package owners.