pipelinerunmetrics

package
v0.59.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ReasonCancelled indicates that a PipelineRun was cancelled.
	// Aliased for backwards compatibility; additional reasons should not be added here.
	ReasonCancelled = v1.PipelineRunReasonCancelled
)

Variables

This section is empty.

Functions

func MetricsOnStore

func MetricsOnStore(logger *zap.SugaredLogger) func(name string,
	value interface{})

MetricsOnStore returns a function that checks if metrics are configured for a config.Store, and registers it if so

func WithClient

func WithClient(ctx context.Context) context.Context

WithClient adds a metrics recorder to the given context

func WithInformer

func WithInformer(ctx context.Context) (context.Context, controller.Informer)

WithInformer returns the given context, and a configured informer

Types

type InformerKey

type InformerKey struct{}

InformerKey is used for associating the Informer inside the context.Context.

type Recorder

type Recorder struct {
	ReportingPeriod time.Duration
	// contains filtered or unexported fields
}

Recorder holds keys for Tekton metrics

func Get

func Get(ctx context.Context) *Recorder

Get extracts the pipelinerunmetrics.Recorder from the context.

func NewRecorder

func NewRecorder(ctx context.Context) (*Recorder, error)

NewRecorder creates a new metrics recorder instance to log the PipelineRun related metrics

func (*Recorder) DurationAndCount

func (r *Recorder) DurationAndCount(pr *v1.PipelineRun, beforeCondition *apis.Condition) error

DurationAndCount logs the duration of PipelineRun execution and count for number of PipelineRuns succeed or failed returns an error if its failed to log the metrics

func (*Recorder) ReportRunningPipelineRuns

func (r *Recorder) ReportRunningPipelineRuns(ctx context.Context, lister listers.PipelineRunLister)

ReportRunningPipelineRuns invokes RunningPipelineRuns on our configured PeriodSeconds until the context is cancelled.

func (*Recorder) RunningPipelineRuns

func (r *Recorder) RunningPipelineRuns(lister listers.PipelineRunLister) error

RunningPipelineRuns logs the number of PipelineRuns running right now returns an error if its failed to log the metrics

type RecorderKey

type RecorderKey struct{}

RecorderKey is used for associating the Recorder inside the context.Context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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