Documentation ¶
Overview ¶
Package flowstats implements the main functions to process and store flow statistics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flow ¶
type Flow struct { Id string Service string DomainName string ServiceIP string LocalIP string Protocol string LocalPort string ServicePort string Cntrs []counters.Counter }
Flow is a general flow structure that contains flow information as well as the counters it needs to collect
func CreateFlow ¶
func CreateFlow() *Flow
type FlowCache ¶
type FlowCache struct {
// contains filtered or unexported fields
}
FlowCache is a cache used to store flows' statistics
func NewFlowCache ¶
func NewFlowCache(t string, serviceMap *servicemap.ServiceMap, evictTime, cleanupTime time.Duration, shardsCount uint32, anonymize bool) (*FlowCache, error)
NewFlowCache initiates a new FlowCache. t specifies the cache type. Possible cache types:
- "ConcurrentCacheMap": Concurrent Map with periodic eviction of expired entries. Currently the only supported cache type
- "BigCache": (NOT IMPLEMENTED) modified version of https://github.com/allegro/bigcache
- "CacheMap": (NOT IMPLEMENTED) a simple map with no concurrency support
- "Map": (NOT IMPLEMENTED) a simple map with no concurrency support
func (*FlowCache) AddServices ¶
func (*FlowCache) DumpToChannel ¶
DumpToChannel copies the entire cache int a channel, entry by entry.
func (*FlowCache) DumpToString ¶
func (fc *FlowCache) DumpToString() []json.RawMessage
Dump copies the entire cache int a map.
type OutCounter ¶
type OutCounter struct { CType string Data json.RawMessage }
type TupleFlow ¶
type TupleFlow struct {
// contains filtered or unexported fields
}
TupleFlow is a special flow that includes the 4-tuple consisting of the network and transport flows src and dst are IP addresses, src2 and dst2 are port numbers
func NewTupleFlow ¶
NewTupleFlow generates a TupleFlow given the 4-tuple