infrastructure

package
v0.0.0-...-953ae9e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCounterMetric

func RegisterCounterMetric(counterMetric prometheus.Counter) *prometheus.Counter

RegisterCounterMetric registers a counter

func RegisterCounterVecMetric

func RegisterCounterVecMetric(counterMetric prometheus.CounterVec) *prometheus.CounterVec

RegisterCounterVecMetric registers a countervec metrics counter

func RegisterGaugeMetric

func RegisterGaugeMetric(gaugeMetric prometheus.GaugeFunc) *prometheus.GaugeFunc

RegisterGaugeMetric registers a gauge metrics counter

func RegisterSummaryVecMetric

func RegisterSummaryVecMetric(summaryMetric prometheus.SummaryVec) *prometheus.SummaryVec

RegisterSummaryVecMetric registers a summary vec counter

Types

type DatabaseCounters

type DatabaseCounters struct {
	NumDatabaseConnections                   *prometheus.GaugeFunc
	IdleDatabaseConnections                  *prometheus.GaugeFunc
	DatabaseConnectionsInUse                 *prometheus.GaugeFunc
	BlockedWaitingTimeForDatabaseConnections *prometheus.GaugeFunc
	LatencyByOperation                       *prometheus.SummaryVec
}

func InitDatabaseCounters

func InitDatabaseCounters(servicename string, db *gorm.DB) *DatabaseCounters

func (*DatabaseCounters) RegisterMetrics

func (rc *DatabaseCounters) RegisterMetrics()

type InfrastructureCounters

type InfrastructureCounters struct {
	RuntimeCounters  *RuntimeCounters
	DatabaseCounters *DatabaseCounters
	RequestCounters  *RequestCounters
	WorkerCounters   *WorkerCounters
}

func New

func New(serviceName string, db *gorm.DB) *InfrastructureCounters

type RequestCounters

type RequestCounters struct {
	RequestLatencySummaryCounters *prometheus.SummaryVec
	TotalRequestsCounters         *prometheus.CounterVec
}

func InitRequestCounters

func InitRequestCounters(servicename string) *RequestCounters

initialize run time counters

func (*RequestCounters) RegisterMetrics

func (rc *RequestCounters) RegisterMetrics()

type RuntimeCounters

type RuntimeCounters struct {
	NumActiveGoRoutines *prometheus.GaugeFunc
}

https://github.com/prometheus/client_golang/blob/master/prometheus/examples_test.go

func InitRuntimeCounters

func InitRuntimeCounters(servicename string) *RuntimeCounters

initialize run time counters

func (*RuntimeCounters) RegisterMetrics

func (rc *RuntimeCounters) RegisterMetrics()

type WorkerCounters

type WorkerCounters struct {
	TotalCompletedTasksCounter         *prometheus.Counter
	TotalCompletedTasksByWorkerCounter *prometheus.CounterVec
}

func InitWorkerCounters

func InitWorkerCounters(servicename string) *WorkerCounters

initialize run time counters

func (*WorkerCounters) RegisterMetrics

func (rc *WorkerCounters) RegisterMetrics()

Jump to

Keyboard shortcuts

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