metrics

package
v2.12.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	GitRequestTypeLsRemote = "ls-remote"
	GitRequestTypeFetch    = "fetch"
)

Variables

This section is empty.

Functions

func NewGitClientEventHandlers added in v2.1.0

func NewGitClientEventHandlers(metricsServer *MetricsServer) git.EventHandlers

NewGitClientEventHandlers creates event handlers that update Git related metrics

Types

type GitRequestType

type GitRequestType string

type MetricsServer

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

func NewMetricsServer

func NewMetricsServer() *MetricsServer

NewMetricsServer returns a new prometheus server which collects application metrics.

func (*MetricsServer) DecPendingRepoRequest

func (m *MetricsServer) DecPendingRepoRequest(repo string)

func (*MetricsServer) GetHandler

func (m *MetricsServer) GetHandler() http.Handler

func (*MetricsServer) IncGitFetchFail added in v2.11.0

func (m *MetricsServer) IncGitFetchFail(repo string, revision string)

func (*MetricsServer) IncGitLsRemoteFail added in v2.12.0

func (m *MetricsServer) IncGitLsRemoteFail(repo string, revision string)

func (*MetricsServer) IncGitRequest

func (m *MetricsServer) IncGitRequest(repo string, requestType GitRequestType)

IncGitRequest increments the git requests counter

func (*MetricsServer) IncPendingRepoRequest

func (m *MetricsServer) IncPendingRepoRequest(repo string)

func (*MetricsServer) IncRedisRequest

func (m *MetricsServer) IncRedisRequest(failed bool)

func (*MetricsServer) ObserveGitRequestDuration

func (m *MetricsServer) ObserveGitRequestDuration(repo string, requestType GitRequestType, duration time.Duration)

func (*MetricsServer) ObserveRedisRequestDuration

func (m *MetricsServer) ObserveRedisRequestDuration(duration time.Duration)

Jump to

Keyboard shortcuts

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