metrics

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package metrics defines the primitives available for the controlplane metrics

Package metrics defines the primitives available for the controlplane metrics

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics interface {
	// Initialize metrics engine
	Init(db.Store) error

	// AddWebhookEventTypeCount adds a count to the webhook event type counter
	AddWebhookEventTypeCount(context.Context, *WebhookEventState)

	// AddTokenOpCount records a token operation (issued, check) and whether the
	// github ID was present at the time of check.
	AddTokenOpCount(context.Context, string, bool)
}

Metrics implements metrics management for the control plane

func NewMetrics

func NewMetrics() Metrics

NewMetrics creates a new controlplane metrics instance.

func NewNoopMetrics

func NewNoopMetrics() Metrics

NewNoopMetrics creates a new controlplane metrics instance.

type WebhookEventState

type WebhookEventState struct {
	// Typ is the type of the event, e.g. pull_request, repository, workflow_run, ...
	Typ string
	// Accepted is whether the event was accepted by engine or filtered out
	Accepted bool
	// Error is whether there was an error processing the event
	Error bool
}

WebhookEventState represents the state of a webhook event

Jump to

Keyboard shortcuts

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