Documentation
¶
Index ¶
- func SetFlowCounter(c FlowCounter)
- type EmptyMetrics
- func (m *EmptyMetrics) AddBlockConnection(addr string)
- func (m *EmptyMetrics) AddConnection(addr string)
- func (m *EmptyMetrics) AddDNSProcess(domain string)
- func (m *EmptyMetrics) AddFailedDNS(domain string, rcode dnsmessage.RCode, t dnsmessage.Type)
- func (m *EmptyMetrics) AddReceiveUDPDroppedPacket()
- func (m *EmptyMetrics) AddReceiveUDPPacket()
- func (m *EmptyMetrics) AddReceiveUDPPacketSize(size int)
- func (m *EmptyMetrics) AddSendUDPDroppedPacket()
- func (m *EmptyMetrics) AddSendUDPPacket()
- func (m *EmptyMetrics) AddSendUDPPacketSize(size int)
- func (m *EmptyMetrics) AddStreamConnectDuration(t float64)
- func (m *EmptyMetrics) AddTCPDialFailed(addr string)
- func (m *EmptyMetrics) RemoveConnection(n int)
- type FlowCounter
- type Metrics
- type Prometheus
- func (p *Prometheus) AddBlockConnection(addr string)
- func (p *Prometheus) AddConnection(addr string)
- func (p *Prometheus) AddDNSProcess(domain string)
- func (p *Prometheus) AddFailedDNS(domain string, rcode dnsmessage.RCode, t dnsmessage.Type)
- func (p *Prometheus) AddReceiveUDPDroppedPacket()
- func (p *Prometheus) AddReceiveUDPPacket()
- func (p *Prometheus) AddReceiveUDPPacketSize(size int)
- func (p *Prometheus) AddSendUDPDroppedPacket()
- func (p *Prometheus) AddSendUDPPacket()
- func (p *Prometheus) AddSendUDPPacketSize(size int)
- func (p *Prometheus) AddStreamConnectDuration(t float64)
- func (p *Prometheus) AddTCPDialFailed(addr string)
- func (p *Prometheus) RemoveConnection(n int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFlowCounter ¶ added in v0.3.8
func SetFlowCounter(c FlowCounter)
Types ¶
type EmptyMetrics ¶ added in v0.3.8
type EmptyMetrics struct{}
func (*EmptyMetrics) AddBlockConnection ¶ added in v0.3.8
func (m *EmptyMetrics) AddBlockConnection(addr string)
func (*EmptyMetrics) AddConnection ¶ added in v0.3.8
func (m *EmptyMetrics) AddConnection(addr string)
func (*EmptyMetrics) AddDNSProcess ¶ added in v0.3.8
func (m *EmptyMetrics) AddDNSProcess(domain string)
func (*EmptyMetrics) AddFailedDNS ¶ added in v0.3.8
func (m *EmptyMetrics) AddFailedDNS(domain string, rcode dnsmessage.RCode, t dnsmessage.Type)
func (*EmptyMetrics) AddReceiveUDPDroppedPacket ¶ added in v0.3.8
func (m *EmptyMetrics) AddReceiveUDPDroppedPacket()
func (*EmptyMetrics) AddReceiveUDPPacket ¶ added in v0.3.8
func (m *EmptyMetrics) AddReceiveUDPPacket()
func (*EmptyMetrics) AddReceiveUDPPacketSize ¶ added in v0.3.8
func (m *EmptyMetrics) AddReceiveUDPPacketSize(size int)
func (*EmptyMetrics) AddSendUDPDroppedPacket ¶ added in v0.3.8
func (m *EmptyMetrics) AddSendUDPDroppedPacket()
func (*EmptyMetrics) AddSendUDPPacket ¶ added in v0.3.8
func (m *EmptyMetrics) AddSendUDPPacket()
func (*EmptyMetrics) AddSendUDPPacketSize ¶ added in v0.3.8
func (m *EmptyMetrics) AddSendUDPPacketSize(size int)
func (*EmptyMetrics) AddStreamConnectDuration ¶ added in v0.3.8
func (m *EmptyMetrics) AddStreamConnectDuration(t float64)
func (*EmptyMetrics) AddTCPDialFailed ¶ added in v0.3.8
func (m *EmptyMetrics) AddTCPDialFailed(addr string)
func (*EmptyMetrics) RemoveConnection ¶ added in v0.3.8
func (m *EmptyMetrics) RemoveConnection(n int)
type FlowCounter ¶ added in v0.3.8
type Metrics ¶
type Metrics interface {
AddReceiveUDPPacket()
AddSendUDPPacket()
AddReceiveUDPDroppedPacket()
AddSendUDPDroppedPacket()
AddReceiveUDPPacketSize(size int)
AddSendUDPPacketSize(size int)
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 = &EmptyMetrics{}
type Prometheus ¶
type Prometheus struct {
TotalReceiveUDPPacket prometheus.Counter
TotalSendUDPPacket prometheus.Counter
TotalReceiveUDPDroppedPacket prometheus.Counter
TotalSendUDPDroppedPacket prometheus.Counter
UDPReceivePacketSize prometheus.Histogram
UDPSendPacketSize prometheus.Histogram
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) AddFailedDNS ¶
func (p *Prometheus) AddFailedDNS(domain string, rcode dnsmessage.RCode, t dnsmessage.Type)
func (*Prometheus) AddReceiveUDPDroppedPacket ¶ added in v0.3.8
func (p *Prometheus) AddReceiveUDPDroppedPacket()
func (*Prometheus) AddReceiveUDPPacket ¶
func (p *Prometheus) AddReceiveUDPPacket()
func (*Prometheus) AddReceiveUDPPacketSize ¶ added in v0.3.8
func (p *Prometheus) AddReceiveUDPPacketSize(size int)
func (*Prometheus) AddSendUDPDroppedPacket ¶ added in v0.3.8
func (p *Prometheus) AddSendUDPDroppedPacket()
func (*Prometheus) AddSendUDPPacket ¶
func (p *Prometheus) AddSendUDPPacket()
func (*Prometheus) AddSendUDPPacketSize ¶ added in v0.3.8
func (p *Prometheus) AddSendUDPPacketSize(size int)
func (*Prometheus) AddStreamConnectDuration ¶
func (p *Prometheus) AddStreamConnectDuration(t float64)
func (*Prometheus) AddTCPDialFailed ¶
func (p *Prometheus) AddTCPDialFailed(addr string)
func (*Prometheus) RemoveConnection ¶
func (p *Prometheus) RemoveConnection(n int)
Click to show internal directories.
Click to hide internal directories.