metrics

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Once           sync.Once
	R              *Recorder
	ErrRegistering error
)

Functions

func ResetRecorder added in v0.29.0

func ResetRecorder()

func WithClient added in v0.29.0

func WithClient(ctx context.Context) context.Context

WithClient adds a metrics recorder to the given context.

func WithInformer added in v0.29.0

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

WithInformer returns the given context, and a configured informer.

Types

type InformerKey added in v0.29.0

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

func Get added in v0.29.0

func Get(ctx context.Context) *Recorder

Get extracts the pipelinerunmetrics.Recorder from the context.

func NewRecorder

func NewRecorder() (*Recorder, error)

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

func (*Recorder) Count

func (r *Recorder) Count(provider, event, namespace, repository string) error

Count logs number of times a pipelinerun is ran for a provider.

func (*Recorder) CountPRDuration added in v0.29.0

func (r *Recorder) CountPRDuration(namespace, repository, status, reason string, duration time.Duration) error

CountPRDuration collects duration taken by a pipelinerun in seconds accumulate them in prDurationCount.

func (*Recorder) EmitRunningPRsMetrics added in v0.29.0

func (r *Recorder) EmitRunningPRsMetrics(prl []*tektonv1.PipelineRun) error

func (*Recorder) ReportRunningPipelineRuns added in v0.29.0

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

ReportRunningPipelineRuns reports running PipelineRuns on our configured ReportingPeriod until the context is cancelled.

func (*Recorder) RunningPipelineRuns added in v0.29.0

func (r *Recorder) RunningPipelineRuns(namespace, repository string, runningPRs float64) error

RunningPipelineRuns emits the number of running PipelineRuns for a repository and namespace.

type RecorderKey added in v0.29.0

type RecorderKey struct{}

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

Jump to

Keyboard shortcuts

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