metrics

package
v4.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StartupTime stores how long the startup took (in seconds).
	StartupTime = promauto.NewGauge(
		prometheus.GaugeOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "startup_seconds",
			Help:      "Seconds taken by the startup",
		},
	)

	// RPCTotalRequestDuration stores the processing time for every request.
	RPCTotalRequestDuration = promauto.NewHistogram(prometheus.HistogramOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "rpc_total_request_duration_seconds",
		Help:      "RPC request processing time for every request",
	})

	// RPCSuccessfulRequestDuration stores the processing time for successful
	// requests partitioned by method.
	RPCSuccessfulRequestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "rpc_successful_request_duration_seconds",
		Help:      "RPC request processing time for successful requests partitioned by method",
	}, []string{"method"})

	// WSConnections keeps track of the number of currently established WS connections.
	WSConnections = promauto.NewGauge(
		prometheus.GaugeOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "ws_connections",
			Help:      "Current number of ws connections established with Marketstore",
		},
	)

	// WriteCSMDuration stores the WriteCSM call durations for writes
	// that didn't result in an error.
	WriteCSMDuration = promauto.NewHistogram(prometheus.HistogramOpts{
		Namespace: namespace,
		Subsystem: subsystem,
		Name:      "write_csm_duration_seconds",
		Help:      "WriteCSM call duration",
		Buckets:   []float64{.0001, .001, .005, .01, .05, .1, .25, .5, 1},
	})

	// TotalDiskUsageBytes stores the total size of DB files managed by Marketstore.
	TotalDiskUsageBytes = promauto.NewGauge(
		prometheus.GaugeOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "total_disk_usage_bytes",
			Help:      "Total disk usage [bytes] of the Marketstore data files",
		})
)

Functions

func StartDiskUsageMonitor added in v4.1.3

func StartDiskUsageMonitor(s Setter, rootDir string, interval time.Duration)

StartDiskUsageMonitor retrieves the total disk usage of the provided directory at each provided time interval, and set it as a prometheus metric.

Types

type Setter added in v4.1.3

type Setter interface {
	Set(m float64)
}

Setter is an interface for prometheus metrics to improve unit-testability.

Jump to

Keyboard shortcuts

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