metrics

package
v2.5.20 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 7 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) 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