metrics

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics interface {
	AddDownload(n int)
	AddUpload(n int)
	AddReceiveUDPPacket()
	AddSendUDPPacket()
	AddConnection(addr string)
	AddBlockConnection(addr string)
	RemoveConnection(n int)
	AddStreamConnectDuration(t float64)
	AddDNSProcess(domain string)
	AddFailedDNS(domain string, rcode dnsmessage.RCode, t dnsmessage.Type)
	AddTCPDialFailed(addr string)
}
var Counter Metrics = NewPrometheus()

type Prometheus

type Prometheus struct {
	TotalDownload         prometheus.Counter
	TotalUpload           prometheus.Counter
	TotalReceiveUDPPacket prometheus.Counter
	TotalSendUDPPacket    prometheus.Counter
	TotalConnection       prometheus.Counter
	CurrentConnection     prometheus.Gauge
	TotalBlockConnection  prometheus.Counter

	StreamConnectDurationSeconds prometheus.Histogram
	StreamConnectSummarySeconds  prometheus.Summary

	DNSProcessTotal prometheus.Counter
	FiledDNSTotal   prometheus.Counter

	TCPDialFailedTotal prometheus.Counter
}

func NewPrometheus

func NewPrometheus() *Prometheus

func (*Prometheus) AddBlockConnection added in v0.3.7

func (p *Prometheus) AddBlockConnection(addr string)

func (*Prometheus) AddConnection

func (p *Prometheus) AddConnection(addr string)

func (*Prometheus) AddDNSProcess

func (p *Prometheus) AddDNSProcess(domain string)

func (*Prometheus) AddDownload

func (p *Prometheus) AddDownload(n int)

func (*Prometheus) AddFailedDNS

func (p *Prometheus) AddFailedDNS(domain string, rcode dnsmessage.RCode, t dnsmessage.Type)

func (*Prometheus) AddReceiveUDPPacket

func (p *Prometheus) AddReceiveUDPPacket()

func (*Prometheus) AddSendUDPPacket

func (p *Prometheus) AddSendUDPPacket()

func (*Prometheus) AddStreamConnectDuration

func (p *Prometheus) AddStreamConnectDuration(t float64)

func (*Prometheus) AddTCPDialFailed

func (p *Prometheus) AddTCPDialFailed(addr string)

func (*Prometheus) AddUpload

func (p *Prometheus) AddUpload(n int)

func (*Prometheus) RemoveConnection

func (p *Prometheus) RemoveConnection(n int)

Jump to

Keyboard shortcuts

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