metrics

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecordGitOperation

func RecordGitOperation(gitRepo *v1alpha1.GitRepository, operation GitOperation, result GitOperationResult, duration time.Duration)

RecordGitOperation records both the increment and observation for git operations.

func RecordSCMCall

func RecordSCMCall(gitRepo *v1alpha1.GitRepository, api SCMAPI, operation SCMOperation, responseCode int, duration time.Duration, rateLimit *RateLimit)

RecordSCMCall records both the increment and observation for SCM API calls, and optionally observes rate limit metrics.

func RecordWebhookCall added in v0.8.0

func RecordWebhookCall(ctpFound bool, responseCode int, duration time.Duration)

RecordWebhookCall records the duration of webhook processing.

Types

type GitOperation

type GitOperation string
const (
	GitOperationClone    GitOperation = "clone"
	GitOperationFetch    GitOperation = "fetch"
	GitOperationPull     GitOperation = "pull"
	GitOperationPush     GitOperation = "push"
	GitOperationLsRemote GitOperation = "ls-remote"
)

type GitOperationResult

type GitOperationResult string
const (
	GitOperationResultSuccess GitOperationResult = "success"
	GitOperationResultFailure GitOperationResult = "failure"
)

func GitOperationResultFromError

func GitOperationResultFromError(err error) GitOperationResult

type RateLimit

type RateLimit struct {
	Limit          int
	Remaining      int
	ResetRemaining time.Duration
}

type SCMAPI

type SCMAPI string
const (
	SCMAPICommitStatus SCMAPI = "CommitStatus"
	SCMAPIPullRequest  SCMAPI = "PullRequest"
)

type SCMOperation

type SCMOperation string
const (
	SCMOperationCreate SCMOperation = "create"
	SCMOperationUpdate SCMOperation = "update"
	SCMOperationMerge  SCMOperation = "merge"
	SCMOperationClose  SCMOperation = "close"
	SCMOperationList   SCMOperation = "list"
)

Jump to

Keyboard shortcuts

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