util

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultJobStartLatencyBuckets = []float64{30, 60, 90, 120, 150, 180, 210, 240, 270, 300}

Functions

func CreateValidMetricNameLabel

func CreateValidMetricNameLabel(prefix, name string) string

func GetOwnerReference

func GetOwnerReference(app *v1beta2.SparkApplication) metav1.OwnerReference

GetOwnerReference returns an OwnerReference pointing to the given app.

func InitializeMetrics

func InitializeMetrics(metricsConfig *MetricConfig)

func IsDriverPod

func IsDriverPod(pod *apiv1.Pod) bool

IsDriverPod returns whether the given pod is a Spark driver Pod.

func IsExecutorPod

func IsExecutorPod(pod *apiv1.Pod) bool

IsExecutorPod returns whether the given pod is a Spark executor Pod.

func IsLaunchedBySparkOperator

func IsLaunchedBySparkOperator(pod *apiv1.Pod) bool

IsLaunchedBySparkOperator returns whether the given pod is launched by the Spark Operator.

func NewHash32

func NewHash32() hash.Hash32

NewHash32 returns a 32-bit hash computed from the given byte slice.

func RegisterMetric

func RegisterMetric(metric prometheus.Collector)

Best effort metric registration with Prometheus.

Types

type ArrayFlags

type ArrayFlags []string

func (*ArrayFlags) Set

func (a *ArrayFlags) Set(value string) error

func (*ArrayFlags) String

func (a *ArrayFlags) String() string

type HistogramBuckets added in v0.1.4

type HistogramBuckets []float64

func (*HistogramBuckets) Set added in v0.1.4

func (hb *HistogramBuckets) Set(value string) error

func (*HistogramBuckets) String added in v0.1.4

func (hb *HistogramBuckets) String() string

type MetricConfig

type MetricConfig struct {
	MetricsEndpoint               string
	MetricsPort                   string
	MetricsPrefix                 string
	MetricsLabels                 []string
	MetricsJobStartLatencyBuckets []float64
}

MetricConfig is a container of configuration properties for the collection and exporting of application metrics to Prometheus.

type PositiveGauge

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

A variant of Prometheus Gauge that only holds non-negative values.

func NewPositiveGauge

func NewPositiveGauge(name string, description string, labels []string) *PositiveGauge

func (*PositiveGauge) Dec

func (p *PositiveGauge) Dec(labelMap map[string]string)

Decrement the metric only if its positive for the labels specified

func (*PositiveGauge) Inc

func (p *PositiveGauge) Inc(labelMap map[string]string)

Increment the Metric for the labels specified

func (*PositiveGauge) Register

func (p *PositiveGauge) Register()

func (*PositiveGauge) Value

func (p *PositiveGauge) Value(labelMap map[string]string) float64

type WorkQueueMetrics

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

func (*WorkQueueMetrics) NewAddsMetric

func (p *WorkQueueMetrics) NewAddsMetric(name string) workqueue.CounterMetric

Adds Count Metrics for the kubernetes workqueue.

func (*WorkQueueMetrics) NewDepthMetric

func (p *WorkQueueMetrics) NewDepthMetric(name string) workqueue.GaugeMetric

Depth Metric for the kubernetes workqueue.

func (*WorkQueueMetrics) NewLatencyMetric

func (p *WorkQueueMetrics) NewLatencyMetric(name string) workqueue.SummaryMetric

Latency Metric for the kubernetes workqueue.

func (*WorkQueueMetrics) NewLongestRunningProcessorMicrosecondsMetric

func (p *WorkQueueMetrics) NewLongestRunningProcessorMicrosecondsMetric(name string) workqueue.SettableGaugeMetric

func (*WorkQueueMetrics) NewRetriesMetric

func (p *WorkQueueMetrics) NewRetriesMetric(name string) workqueue.CounterMetric

Retry Metric for the kubernetes workqueue.

func (*WorkQueueMetrics) NewUnfinishedWorkSecondsMetric

func (p *WorkQueueMetrics) NewUnfinishedWorkSecondsMetric(name string) workqueue.SettableGaugeMetric

func (*WorkQueueMetrics) NewWorkDurationMetric

func (p *WorkQueueMetrics) NewWorkDurationMetric(name string) workqueue.SummaryMetric

WorkDuration Metric for the kubernetes workqueue.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL