metrics

package
v0.41.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostTag

func HostTag(ctx context.Context, host string) metrics.Tag

HostTag returns a host tag

func InstanceGroupTag

func InstanceGroupTag(ctx context.Context, instanceGroup string) metrics.Tag

InstanceGroupTag returns an instance group tag

func OutcomeTag

func OutcomeTag(ctx context.Context, outcome string) metrics.Tag

OutcomeTag returns an outcome tag

func PathTag

func PathTag(ctx context.Context, url url.URL) metrics.Tag

PathTag returns a url tag

func QueueIndexTag

func QueueIndexTag(ctx context.Context, index int) metrics.Tag

QueueIndexTag returns a queue index tag

func RegisterInformerDelayMetrics

func RegisterInformerDelayMetrics(ctx context.Context, informer coreinformers.PodInformer)

RegisterInformerDelayMetrics registers an event handler to the pod informer to report delays

func ReportCrossZoneMetric

func ReportCrossZoneMetric(ctx context.Context, driverNodeName string, executorNodeNames []string, nodes []*v1.Node)

ReportCrossZoneMetric reports metric about cross AZ traffic between pods of a spark application

func SparkRoleTag

func SparkRoleTag(ctx context.Context, role string) metrics.Tag

SparkRoleTag returns a spark role tag

func StatusCodeTag

func StatusCodeTag(ctx context.Context, statusCode string) metrics.Tag

StatusCodeTag returns a status code tag

func VerbTag

func VerbTag(ctx context.Context, verb string) metrics.Tag

VerbTag returns a request verb tag

Types

type CacheMetrics

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

CacheMetrics reports metrics for resource reservation and demand caches

func NewCacheMetrics

func NewCacheMetrics(
	resourceReservationLister sparkschedulerlisters.ResourceReservationLister,
	resourceReservations *cache.ResourceReservationCache,
	demands *cache.SafeDemandCache,
) *CacheMetrics

NewCacheMetrics creates a new CacheMetrics object

func (*CacheMetrics) StartReporting

func (c *CacheMetrics) StartReporting(ctx context.Context)

StartReporting starts periodic reporting for cache metrics

type PendingPodQueueReporter

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

PendingPodQueueReporter reports queue sizes periodically

func NewQueueReporter

func NewQueueReporter(podLister corelisters.PodLister, instanceGroupTagLabel string) *PendingPodQueueReporter

NewQueueReporter returns a new ResourceUsageReporter instance

func (*PendingPodQueueReporter) StartReportingQueues

func (r *PendingPodQueueReporter) StartReportingQueues(ctx context.Context)

StartReportingQueues starts periodic resource usage reporting

type PodHistograms

type PodHistograms map[PodTags]histogramWithCount

PodHistograms keep the count and duration of lifecycle states of a spark pod

func (PodHistograms) Inc

func (p PodHistograms) Inc(key PodTags)

Inc increases the counter of the given key by one

func (PodHistograms) Mark

func (p PodHistograms) Mark(key PodTags, duration time.Duration)

Mark marks the histogram for the key with the nanoseconds of given duration

func (PodHistograms) MarkTimes

func (p PodHistograms) MarkTimes(ctx context.Context, pod *v1.Pod, instanceGroupTagLabel string, now time.Time)

MarkTimes inspects pod conditions and marks lifecycle transition times

type PodTags

type PodTags struct {
	InstanceGroup, SparkRole, Lifecycle metrics.Tag
}

PodTags represent a tag set for a lifecycle event for a spark pod

type ResourceUsageReporter

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

ResourceUsageReporter reports resource usage periodically

func NewResourceReporter

func NewResourceReporter(
	nodeLister corelisters.NodeLister,
	resourceReservations *cache.ResourceReservationCache,
	instanceGroupTagLabel string) *ResourceUsageReporter

NewResourceReporter returns a new ResourceUsageReporter instance

func (*ResourceUsageReporter) StartReportingResourceUsage

func (r *ResourceUsageReporter) StartReportingResourceUsage(ctx context.Context)

StartReportingResourceUsage starts periodic resource usage reporting

type ScheduleTimer

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

ScheduleTimer marks pod scheduling time metrics

func NewScheduleTimer

func NewScheduleTimer(ctx context.Context, instanceGroup string, pod *v1.Pod) *ScheduleTimer

NewScheduleTimer creates a new ScheduleTimer

func (*ScheduleTimer) Mark

func (s *ScheduleTimer) Mark(ctx context.Context, role, outcome string)

Mark marks scheduling timer metrics with durations from current time

func (*ScheduleTimer) MarkReconciliationFinished

func (s *ScheduleTimer) MarkReconciliationFinished(ctx context.Context)

MarkReconciliationFinished marks when the reconciliation finished successfully

type SoftReservationCompactionTimer

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

SoftReservationCompactionTimer tracks and reports the time it takes to compact soft reservations to resource reservations

func GetAndStartSoftReservationCompactionTimer

func GetAndStartSoftReservationCompactionTimer() *SoftReservationCompactionTimer

GetAndStartSoftReservationCompactionTimer returns a SoftReservationCompactionTimer which starts counting the time immediately

func (*SoftReservationCompactionTimer) MarkCompactionComplete

func (dct *SoftReservationCompactionTimer) MarkCompactionComplete(ctx context.Context)

MarkCompactionComplete emits a metric with the time difference between now and when the timer was started by GetAndStartSoftReservationCompactionTimer()

type SoftReservationMetrics

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

SoftReservationMetrics reports metrics on the SoftReservationStore passed

func NewSoftReservationMetrics

func NewSoftReservationMetrics(ctx context.Context, store *cache.SoftReservationStore, podLister corelisters.PodLister, resourceReservations *cache.ResourceReservationCache) *SoftReservationMetrics

NewSoftReservationMetrics creates a SoftReservationMetrics

func (*SoftReservationMetrics) StartReporting

func (s *SoftReservationMetrics) StartReporting(ctx context.Context)

StartReporting starts periodic reporting for SoftReservationStore metrics

type SparkPodConditions

type SparkPodConditions map[v1.PodConditionType]v1.PodCondition

SparkPodConditions provides spark related lifecycle events from pod conditions

func NewSparkPodConditions

func NewSparkPodConditions(conditions []v1.PodCondition) SparkPodConditions

NewSparkPodConditions creates a new SparkPodConditions instance

func (SparkPodConditions) TimeWhenTrue

func (s SparkPodConditions) TimeWhenTrue(conditionType v1.PodConditionType) (time.Time, bool)

TimeWhenTrue returns the last transition time if the given conditions status is true

type WasteMetricsReporter

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

WasteMetricsReporter tracks and reports on scheduler latencies between demand creation and pod scheduling times in granular phases so we can keep track of any delays. This is a best-effort reporter in that it keeps track of state in memory.

func NewWasteMetricsReporter

func NewWasteMetricsReporter(ctx context.Context, instanceGroupLabel string) *WasteMetricsReporter

NewWasteMetricsReporter returns an instance of WasteMetricsReporter

func (*WasteMetricsReporter) MarkFailedSchedulingAttempt

func (r *WasteMetricsReporter) MarkFailedSchedulingAttempt(pod *v1.Pod, outcome string)

MarkFailedSchedulingAttempt should be called to indicate that scheduling for the passed pod failed with that outcome.

func (*WasteMetricsReporter) StartSchedulingOverheadMetrics

func (r *WasteMetricsReporter) StartSchedulingOverheadMetrics(
	podInformer coreinformers.PodInformer,
	demandInformer *crd.LazyDemandInformer,
)

StartSchedulingOverheadMetrics will start tracking demand creation and fulfillment times and report scheduling wasted time per pod

Jump to

Keyboard shortcuts

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