Documentation
¶
Index ¶
Constants ¶
View Source
const ( // TCP protocol. IP_PROTO_TCP = 6 // UDP protocol. IP_PROTO_UDP = 17 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClockInterface ¶
ClockInterface is a dummy interface used to generate a mock "clock" implementation used in unit tests. This lets us dynamically test timestamped Prometheus metrics.
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector is an implementation of the Prometheus collector that reports flow data.
func NewCollector ¶
func NewCollector(conntrack ConntrackInterface, flowHandler pb.FlowHandlerClient, clock ClockInterface, collectionInterval time.Duration, localNode string, skipConntrackSanityCheck bool, uptimeWaitDuration time.Duration) (*Collector, error)
NewCollector creates a new Collector and validates that it can retrieve conntrack packet and byte counts.
type ConntrackInterface ¶
type ConntrackInterface interface {
Dump(opts *conntrack.DumpOptions) ([]conntrack.Flow, error)
}
ConntrackInterface is a dummy interface used to generate a mock "conntrack" implementation used in unit tests.
Click to show internal directories.
Click to hide internal directories.