metrics_config

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Enabled:          false,
	EnabledExpensive: false,
	HTTP:             "127.0.0.1",
	Port:             6060,
}

DefaultConfig is the default config for metrics used in go-quai.

Functions

func EnableMetrics

func EnableMetrics()

func MetricsEnabled

func MetricsEnabled() bool

func NewCounter

func NewCounter(name string, help string) *prometheus.Counter

func NewCounterVec

func NewCounterVec(name string, help string) *prometheus.CounterVec

func NewGauge

func NewGauge(name string, help string) *prometheus.Gauge

func NewGaugeVec

func NewGaugeVec(name string, help string) *prometheus.GaugeVec

func NewTimer

func NewTimer(name string, help string) *prometheus.Timer

func StartProcessMetrics

func StartProcessMetrics()

Types

type CPUStats

type CPUStats struct {
	GlobalTime int64 // Time spent by the CPU working on all processes
	GlobalWait int64 // Time spent by waiting on disk for all processes
	LocalTime  int64 // Time spent by the CPU working on this process
}

CPUStats is the system and process CPU stats.

type Config

type Config struct {
	Enabled          bool   `toml:",omitempty"`
	EnabledExpensive bool   `toml:",omitempty"`
	HTTP             string `toml:",omitempty"`
	Port             int    `toml:",omitempty"`
}

Config contains the configuration for the metric collection.

type DiskStats

type DiskStats struct {
	ReadCount  int64 // Number of read operations executed
	ReadBytes  int64 // Total number of bytes read
	WriteCount int64 // Number of write operations executed
	WriteBytes int64 // Total number of byte written
}

DiskStats is the per process disk io stats.

Jump to

Keyboard shortcuts

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