util

package
v0.0.0-...-5a4102e Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 19 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 InitializeIngressCapabilities

func InitializeIngressCapabilities(client kubernetes.Interface) (err error)

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 Capabilities

type Capabilities map[string]bool
var (
	IngressCapabilities Capabilities
)

func (Capabilities) Has

func (c Capabilities) Has(wanted string) bool

func (Capabilities) String

func (c Capabilities) String() string

type HistogramBuckets

type HistogramBuckets []float64

func (*HistogramBuckets) Set

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

func (*HistogramBuckets) String

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.HistogramMetric

Latency Metric for the kubernetes workqueue.

func (*WorkQueueMetrics) NewLongestRunningProcessorSecondsMetric

func (p *WorkQueueMetrics) NewLongestRunningProcessorSecondsMetric(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.HistogramMetric

WorkDuration Metric for the kubernetes workqueue.

Jump to

Keyboard shortcuts

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