metrics

package
v0.0.0-...-5b6649e Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const MB = 1 << 20

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorEvent

type ErrorEvent struct {
	Status   int
	ErrMsg   string
	Duration time.Duration
}

type MetricsCollector

type MetricsCollector interface {
	PostSuccess(event SuccessEvent)
	PostFailure(event ErrorEvent)
}

func NewPrometheusMetricsCollector

func NewPrometheusMetricsCollector(r prometheus.Registerer) MetricsCollector

type PrometheusMetricsCollector

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

func (*PrometheusMetricsCollector) PostFailure

func (b *PrometheusMetricsCollector) PostFailure(event ErrorEvent)

func (*PrometheusMetricsCollector) PostSuccess

func (b *PrometheusMetricsCollector) PostSuccess(event SuccessEvent)

type SuccessEvent

type SuccessEvent struct {
	Status        int
	ResponseSize  int64
	Duration      time.Duration
	FirstByteTime time.Duration
}

Jump to

Keyboard shortcuts

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