metrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMetricsServer

func StartMetricsServer(metricsType Type) *http.Server

StartMetricsServer starts server that handles metrics Prometheus: http://localhost:2112/metrics Expvar : http://localhost:2112/debug/vars

Types

type Metrics

type Metrics struct {
	RequestCounter            metrics.Counter
	ResponseCounter           metrics.Counter
	PanicCounter              metrics.Counter
	RobotsTxtRequestCounter   metrics.Counter
	RobotsTxtResponseCounter  metrics.Counter
	RobotsTxtForbiddenCounter metrics.Counter
}

Metrics type stores metrics

func NewMetrics

func NewMetrics(metricsType Type) *Metrics

NewMetrics creates new metrics with given metrics.Type

type Type

type Type int

Type represents metrics Types

const (
	// Discard discards any metrics.
	Discard Type = iota

	// Prometheus starts server at :2112 and exports metrics data to /metrics
	Prometheus

	// ExpVar uses built-in expvar package
	ExpVar
)

Jump to

Keyboard shortcuts

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