metrics

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CPURatio = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "sentinel_process_cpu_ratio",
			Help: "current process cpu utilization ratio",
		},
		[]string{"host", "process", "cpu", "process_cpu_ratio"},
	)
	ProcessMemorySize = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "sentinel_process_memory_size",
			Help: "current process memory size in bytes",
		},
		[]string{"host", "process", "pid", "total_memory_size"},
	)
	ResourceFlowThreshold = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "sentinel_resource_flow_threshold",
			Help: "resource flow threshold",
		},
		[]string{"host", "resource", "threshold"},
	)
)

Functions

func RegisterSentinelMetrics

func RegisterSentinelMetrics(registry *prometheus.Registry)

func ResetSentinelMetrics

func ResetSentinelMetrics()

Reset all metrics to zero

func SetCPURatio

func SetCPURatio(ratio float64)

SetCPURatio sets the # of current process's cpu ratio

func SetProcessMemorySize

func SetProcessMemorySize(size int64)

SetProcessMemorySize sets the # of current process's memory

func SetResourceFlowThreshold

func SetResourceFlowThreshold(resource string, threshold float64)

SetResourceFlowThreshold sets the # of resource threshold

Types

This section is empty.

Jump to

Keyboard shortcuts

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