Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MaxFlows int // maximum number of active (non-filtered) flows allowed at a time MinSamples int // minimum number of samples required to return ended flows for further processing Log bool // if true, logging is enabled }
A Config contains the tracker configuration.
type Flow ¶
type Flow struct { ID sampler.ID // flow ID Data []sampler.Data // flow data StartTime time.Time // start time (use only when wall time needed, otherwise use monotonic timestamps in Data) EndTime time.Time // end time (use only when wall time needed, otherwise use monotonic timestamps in Data) Filtered bool // true if flow will be tracked but data not recorded/returned Sampled bool // true if flow was sampled during current track operation PreExisting bool // true if flow already existed on startup Partial bool // true if flow was pre-existing or no final sample was seen SamplesDeduped int // number of samples de-duped EndTstampNs uint64 // monotonic nsec time of last sample, even if it was de-duped }
A Flow contains the data needed by the tracker for one flow.
type Metrics ¶
type Tracker ¶
type Tracker struct { Config // contains filtered or unexported fields }
func NewTracker ¶
func (*Tracker) Track ¶
Track tracks flows by adding samples to non-filtered flows, deleting any ended flows (those with missing samples), and returning any ended flows that pass the tracker's configured constraints.
As an optimization, when enforcing filtering rules, we could allow some new flows to start in the same track operation that other flows end, but for now we don't do so to avoid the added complexity.
Click to show internal directories.
Click to hide internal directories.