statistics

package
v0.0.0-...-2b49871 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Time       time.Time
	Connection *conman.Connection
	Rule       *rule.Rule
}

func NewEvent

func NewEvent(con *conman.Connection, match *rule.Rule) *Event

func (*Event) Serialize

func (e *Event) Serialize() *protocol.Event

type Statistics

type Statistics struct {
	sync.Mutex

	Started      time.Time
	DNSResponses int
	Connections  int
	Ignored      int
	Accepted     int
	Dropped      int
	RuleHits     int
	RuleMisses   int
	Events       []*Event
	ByProto      map[string]uint64
	ByAddress    map[string]uint64
	ByHost       map[string]uint64
	ByPort       map[string]uint64
	ByUID        map[string]uint64
	ByExecutable map[string]uint64
	// contains filtered or unexported fields
}

func New

func New(rules *rule.Loader) (stats *Statistics)

func (*Statistics) OnConnectionEvent

func (s *Statistics) OnConnectionEvent(con *conman.Connection, match *rule.Rule, wasMissed bool)

func (*Statistics) OnDNSResponse

func (s *Statistics) OnDNSResponse()

func (*Statistics) OnIgnored

func (s *Statistics) OnIgnored()

func (*Statistics) Serialize

func (s *Statistics) Serialize() *protocol.Statistics

Jump to

Keyboard shortcuts

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