kubernetes: k8s.io/kubernetes/test/e2e/framework/metrics Index | Files

package metrics

import "k8s.io/kubernetes/test/e2e/framework/metrics"

Index

Package Files

api.go api_server_metrics.go cluster_autoscaler_metrics.go controller_manager_metrics.go e2e_metrics.go interesting_metrics.go kubelet_metrics.go latencies.go metrics_grabber.go pod.go scheduler_metrics.go scheduling.go

Constants

const (
    // SingleCallTimeout is how long to try single API calls (like 'get' or 'list'). Used to prevent
    // transient failures from failing tests.
    // TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed.
    SingleCallTimeout = 5 * time.Minute
)

func APICallToPerfData Uses

func APICallToPerfData(apicalls *APIResponsiveness) *e2eperftype.PerfData

APICallToPerfData transforms APIResponsiveness to PerfData.

func PodStartupLatencyToPerfData Uses

func PodStartupLatencyToPerfData(latency *PodStartupLatency) *e2eperftype.PerfData

PodStartupLatencyToPerfData transforms PodStartupLatency to PerfData.

func PrettyPrintJSON Uses

func PrettyPrintJSON(metrics interface{}) string

PrettyPrintJSON converts metrics to JSON format. TODO: This function should be replaced with framework.PrettyPrintJSON after solving circulary dependency between core framework and this metrics subpackage.

func PrintLatencies Uses

func PrintLatencies(latencies []PodLatencyData, header string)

PrintLatencies outputs latencies to log with readable format.

func VerifyLatencyWithinThreshold Uses

func VerifyLatencyWithinThreshold(threshold, actual LatencyMetric, metricName string) error

VerifyLatencyWithinThreshold verifies whether 50, 90 and 99th percentiles of a latency metric are within the expected threshold.

type APICall Uses

type APICall struct {
    Resource    string        `json:"resource"`
    Subresource string        `json:"subresource"`
    Verb        string        `json:"verb"`
    Scope       string        `json:"scope"`
    Latency     LatencyMetric `json:"latency"`
    Count       int           `json:"count"`
}

APICall is a struct for managing API call.

type APIResponsiveness Uses

type APIResponsiveness struct {
    APICalls []APICall `json:"apicalls"`
}

APIResponsiveness is a struct for managing multiple API calls.

func (*APIResponsiveness) Len Uses

func (a *APIResponsiveness) Len() int

func (*APIResponsiveness) Less Uses

func (a *APIResponsiveness) Less(i, j int) bool

func (*APIResponsiveness) PrintHumanReadable Uses

func (a *APIResponsiveness) PrintHumanReadable() string

PrintHumanReadable returns metrics with JSON format.

func (*APIResponsiveness) PrintJSON Uses

func (a *APIResponsiveness) PrintJSON() string

PrintJSON returns metrics of PerfData(50, 90 and 99th percentiles) with JSON format.

func (*APIResponsiveness) SummaryKind Uses

func (a *APIResponsiveness) SummaryKind() string

SummaryKind returns the summary of API responsiveness.

func (*APIResponsiveness) Swap Uses

func (a *APIResponsiveness) Swap(i, j int)

type APIServerMetrics Uses

type APIServerMetrics testutil.Metrics

APIServerMetrics is metrics for API server

func (*APIServerMetrics) Equal Uses

func (m *APIServerMetrics) Equal(o APIServerMetrics) bool

Equal returns true if all metrics are the same as the arguments.

type ClusterAutoscalerMetrics Uses

type ClusterAutoscalerMetrics testutil.Metrics

ClusterAutoscalerMetrics is metrics for cluster autoscaler

func (*ClusterAutoscalerMetrics) Equal Uses

func (m *ClusterAutoscalerMetrics) Equal(o ClusterAutoscalerMetrics) bool

Equal returns true if all metrics are the same as the arguments.

type Collection Uses

type Collection struct {
    APIServerMetrics         APIServerMetrics
    ControllerManagerMetrics ControllerManagerMetrics
    KubeletMetrics           map[string]KubeletMetrics
    SchedulerMetrics         SchedulerMetrics
    ClusterAutoscalerMetrics ClusterAutoscalerMetrics
}

Collection is metrics collection of components

type ComponentCollection Uses

type ComponentCollection Collection

ComponentCollection is metrics collection of components.

func (*ComponentCollection) ComputeClusterAutoscalerMetricsDelta Uses

func (m *ComponentCollection) ComputeClusterAutoscalerMetricsDelta(before Collection)

ComputeClusterAutoscalerMetricsDelta computes the change in cluster autoscaler metrics.

func (*ComponentCollection) PrintHumanReadable Uses

func (m *ComponentCollection) PrintHumanReadable() string

PrintHumanReadable returns e2e metrics with JSON format.

func (*ComponentCollection) PrintJSON Uses

func (m *ComponentCollection) PrintJSON() string

PrintJSON returns e2e metrics with JSON format.

func (*ComponentCollection) SummaryKind Uses

func (m *ComponentCollection) SummaryKind() string

SummaryKind returns the summary of e2e metrics.

type ControllerManagerMetrics Uses

type ControllerManagerMetrics testutil.Metrics

ControllerManagerMetrics is metrics for controller manager

func (*ControllerManagerMetrics) Equal Uses

func (m *ControllerManagerMetrics) Equal(o ControllerManagerMetrics) bool

Equal returns true if all metrics are the same as the arguments.

type Grabber Uses

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

Grabber provides functions which grab metrics from components

func NewMetricsGrabber Uses

func NewMetricsGrabber(c clientset.Interface, ec clientset.Interface, kubelets bool, scheduler bool, controllers bool, apiServer bool, clusterAutoscaler bool) (*Grabber, error)

NewMetricsGrabber returns new metrics which are initialized.

func (*Grabber) Grab Uses

func (g *Grabber) Grab() (Collection, error)

Grab returns metrics from corresponding component

func (*Grabber) GrabFromAPIServer Uses

func (g *Grabber) GrabFromAPIServer() (APIServerMetrics, error)

GrabFromAPIServer returns metrics from API server

func (*Grabber) GrabFromClusterAutoscaler Uses

func (g *Grabber) GrabFromClusterAutoscaler() (ClusterAutoscalerMetrics, error)

GrabFromClusterAutoscaler returns metrics from cluster autoscaler

func (*Grabber) GrabFromControllerManager Uses

func (g *Grabber) GrabFromControllerManager() (ControllerManagerMetrics, error)

GrabFromControllerManager returns metrics from controller manager

func (*Grabber) GrabFromKubelet Uses

func (g *Grabber) GrabFromKubelet(nodeName string) (KubeletMetrics, error)

GrabFromKubelet returns metrics from kubelet

func (*Grabber) GrabFromScheduler Uses

func (g *Grabber) GrabFromScheduler() (SchedulerMetrics, error)

GrabFromScheduler returns metrics from scheduler

func (*Grabber) HasRegisteredMaster Uses

func (g *Grabber) HasRegisteredMaster() bool

HasRegisteredMaster returns if metrics grabber was able to find a master node

type KubeletLatencyMetric Uses

type KubeletLatencyMetric struct {
    // eg: list, info, create
    Operation string
    // eg: sync_pods, pod_worker
    Method string
    // 0 <= quantile <=1, e.g. 0.95 is 95%tile, 0.5 is median.
    Quantile float64
    Latency  time.Duration
}

KubeletLatencyMetric stores metrics scraped from the kubelet server's /metric endpoint. TODO: Get some more structure around the metrics and this type

type KubeletLatencyMetrics Uses

type KubeletLatencyMetrics []KubeletLatencyMetric

KubeletLatencyMetrics implements sort.Interface for []KubeletMetric based on the latency field.

func GetDefaultKubeletLatencyMetrics Uses

func GetDefaultKubeletLatencyMetrics(ms KubeletMetrics) KubeletLatencyMetrics

GetDefaultKubeletLatencyMetrics calls GetKubeletLatencyMetrics with a set of default metricNames identifying common latency metrics. Note that the KubeletMetrics passed in should not contain subsystem prefix.

func GetKubeletLatencyMetrics Uses

func GetKubeletLatencyMetrics(ms KubeletMetrics, filterMetricNames sets.String) KubeletLatencyMetrics

GetKubeletLatencyMetrics filters ms to include only those contained in the metricNames set, then constructs a KubeletLatencyMetrics list based on the samples associated with those metrics.

func HighLatencyKubeletOperations Uses

func HighLatencyKubeletOperations(c clientset.Interface, threshold time.Duration, nodeName string, logFunc func(fmt string, args ...interface{})) (KubeletLatencyMetrics, error)

HighLatencyKubeletOperations logs and counts the high latency metrics exported by the kubelet server via /metrics.

func (KubeletLatencyMetrics) Len Uses

func (a KubeletLatencyMetrics) Len() int

func (KubeletLatencyMetrics) Less Uses

func (a KubeletLatencyMetrics) Less(i, j int) bool

func (KubeletLatencyMetrics) Swap Uses

func (a KubeletLatencyMetrics) Swap(i, j int)

type KubeletMetrics Uses

type KubeletMetrics testutil.Metrics

KubeletMetrics is metrics for kubelet

func GetKubeletMetrics Uses

func GetKubeletMetrics(c clientset.Interface, nodeName string) (KubeletMetrics, error)

GetKubeletMetrics gets all metrics in kubelet subsystem from specified node and trims the subsystem prefix.

func GrabKubeletMetricsWithoutProxy Uses

func GrabKubeletMetricsWithoutProxy(nodeName, path string) (KubeletMetrics, error)

GrabKubeletMetricsWithoutProxy retrieve metrics from the kubelet on the given node using a simple GET over http. Currently only used in integration tests.

func NewKubeletMetrics Uses

func NewKubeletMetrics() KubeletMetrics

NewKubeletMetrics returns new metrics which are initialized.

func (*KubeletMetrics) Equal Uses

func (m *KubeletMetrics) Equal(o KubeletMetrics) bool

Equal returns true if all metrics are the same as the arguments.

type LatencyMetric Uses

type LatencyMetric struct {
    Perc50  time.Duration `json:"Perc50"`
    Perc90  time.Duration `json:"Perc90"`
    Perc99  time.Duration `json:"Perc99"`
    Perc100 time.Duration `json:"Perc100"`
}

LatencyMetric is a struct for dashboard metrics.

func ExtractLatencyMetrics Uses

func ExtractLatencyMetrics(latencies []PodLatencyData) LatencyMetric

ExtractLatencyMetrics returns latency metrics for each percentile(50th, 90th and 99th).

type LatencySlice Uses

type LatencySlice []PodLatencyData

LatencySlice is an array of PodLatencyData which encapsulates pod startup latency information.

func (LatencySlice) Len Uses

func (a LatencySlice) Len() int

func (LatencySlice) Less Uses

func (a LatencySlice) Less(i, j int) bool

func (LatencySlice) Swap Uses

func (a LatencySlice) Swap(i, j int)

type PodLatencyData Uses

type PodLatencyData struct {
    // Name of the pod
    Name string
    // Node this pod was running on
    Node string
    // Latency information related to pod startuptime
    Latency time.Duration
}

PodLatencyData encapsulates pod startup latency information.

type PodStartupLatency Uses

type PodStartupLatency struct {
    CreateToScheduleLatency LatencyMetric `json:"createToScheduleLatency"`
    ScheduleToRunLatency    LatencyMetric `json:"scheduleToRunLatency"`
    RunToWatchLatency       LatencyMetric `json:"runToWatchLatency"`
    ScheduleToWatchLatency  LatencyMetric `json:"scheduleToWatchLatency"`
    E2ELatency              LatencyMetric `json:"e2eLatency"`
}

PodStartupLatency is a struct for managing latency of pod startup.

func (*PodStartupLatency) PrintHumanReadable Uses

func (l *PodStartupLatency) PrintHumanReadable() string

PrintHumanReadable returns pod startup letency with JSON format.

func (*PodStartupLatency) PrintJSON Uses

func (l *PodStartupLatency) PrintJSON() string

PrintJSON returns pod startup letency with JSON format.

func (*PodStartupLatency) SummaryKind Uses

func (l *PodStartupLatency) SummaryKind() string

SummaryKind returns the summary of pod startup latency.

type SchedulerMetrics Uses

type SchedulerMetrics testutil.Metrics

SchedulerMetrics is metrics for scheduler

func (*SchedulerMetrics) Equal Uses

func (m *SchedulerMetrics) Equal(o SchedulerMetrics) bool

Equal returns true if all metrics are the same as the arguments.

type SchedulingMetrics Uses

type SchedulingMetrics struct {
    PredicateEvaluationLatency  LatencyMetric `json:"predicateEvaluationLatency"`
    PriorityEvaluationLatency   LatencyMetric `json:"priorityEvaluationLatency"`
    PreemptionEvaluationLatency LatencyMetric `json:"preemptionEvaluationLatency"`
    BindingLatency              LatencyMetric `json:"bindingLatency"`
    ThroughputAverage           float64       `json:"throughputAverage"`
    ThroughputPerc50            float64       `json:"throughputPerc50"`
    ThroughputPerc90            float64       `json:"throughputPerc90"`
    ThroughputPerc99            float64       `json:"throughputPerc99"`
}

SchedulingMetrics is a struct for managing scheduling metrics.

func (*SchedulingMetrics) PrintHumanReadable Uses

func (l *SchedulingMetrics) PrintHumanReadable() string

PrintHumanReadable returns scheduling metrics with JSON format.

func (*SchedulingMetrics) PrintJSON Uses

func (l *SchedulingMetrics) PrintJSON() string

PrintJSON returns scheduling metrics with JSON format.

func (*SchedulingMetrics) SummaryKind Uses

func (l *SchedulingMetrics) SummaryKind() string

SummaryKind returns the summary of scheduling metrics.

Package metrics imports 23 packages (graph) and is imported by 256 packages. Updated 2019-11-13. Refresh now. Tools for package owners.