sflow

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 21 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAgentAlreadyAllocated error agent already allocated for this uuid
	ErrAgentAlreadyAllocated = errors.New("agent already allocated for this uuid")
)

Functions

func SFMetadataDecoder added in v0.22.0

func SFMetadataDecoder(raw json.RawMessage) (getter.Getter, error)

SFMetadataDecoder implements a json message raw decoder

Types

type Agent added in v0.21.0

type Agent struct {
	insanelock.RWMutex
	UUID       string
	FlowTable  *flow.Table
	Conn       *net.UDPConn
	Addr       string
	Port       int
	BPFFilter  string
	HeaderSize uint32
	Graph      *graph.Graph
	Node       *graph.Node
}

Agent describes SFlow agent probe

func NewAgent added in v0.21.0

func NewAgent(u string, conn *net.UDPConn, addr string, port int, ft *flow.Table, bpfFilter string, headerSize uint32, n *graph.Node, g *graph.Graph) *Agent

NewAgent creates a new sFlow agent which will populate the given flowtable

func (*Agent) GetTarget added in v0.21.0

func (sfa *Agent) GetTarget() string

GetTarget returns the current used connection

func (*Agent) Start added in v0.21.0

func (sfa *Agent) Start()

Start the SFlow probe agent

func (*Agent) Stop added in v0.21.0

func (sfa *Agent) Stop()

Stop the SFlow probe agent

type AgentAllocator added in v0.21.0

type AgentAllocator struct {
	insanelock.RWMutex
	// contains filtered or unexported fields
}

AgentAllocator describes an SFlow agent allocator to manage multiple SFlow agent probe

func NewAgentAllocator added in v0.21.0

func NewAgentAllocator() (*AgentAllocator, error)

NewAgentAllocator creates a new sFlow agent allocator

func (*AgentAllocator) Alloc added in v0.21.0

func (a *AgentAllocator) Alloc(uuid string, ft *flow.Table, bpfFilter string, headerSize uint32, addr *service.Address, n *graph.Node, g *graph.Graph) (*Agent, error)

Alloc allocates a new sFlow agent

func (*AgentAllocator) Release added in v0.21.0

func (a *AgentAllocator) Release(uuid string)

Release a sFlow agent

func (*AgentAllocator) ReleaseAll added in v0.21.0

func (a *AgentAllocator) ReleaseAll()

ReleaseAll sFlow agents

type EthMetric added in v0.23.0

type EthMetric struct {
	EthAlignmentErrors           int64 `json:"EthAlignmentErrors,omitempty"`
	EthFCSErrors                 int64 `json:"EthFCSErrors,omitempty"`
	EthSingleCollisionFrames     int64 `json:"EthSingleCollisionFrames,omitempty"`
	EthMultipleCollisionFrames   int64 `json:"EthMultipleCollisionFrames,omitempty"`
	EthSQETestErrors             int64 `json:"EthSQETestErrors,omitempty"`
	EthDeferredTransmissions     int64 `json:"EthDeferredTransmissions,omitempty"`
	EthLateCollisions            int64 `json:"EthLateCollisions,omitempty"`
	EthExcessiveCollisions       int64 `json:"EthExcessiveCollisions,omitempty"`
	EthInternalMacReceiveErrors  int64 `json:"EthInternalMacReceiveErrors,omitempty"`
	EthInternalMacTransmitErrors int64 `json:"EthInternalMacTransmitErrors,omitempty"`
	EthCarrierSenseErrors        int64 `json:"EthCarrierSenseErrors,omitempty"`
	EthFrameTooLongs             int64 `json:"EthFrameTooLongs,omitempty"`
	EthSymbolErrors              int64 `json:"EthSymbolErrors,omitempty"`
}

EthMetric the SFlow ethernet counters easyjson:json gendecoder

func (*EthMetric) GetField added in v0.26.0

func (obj *EthMetric) GetField(key string) (interface{}, error)

func (*EthMetric) GetFieldBool added in v0.26.0

func (obj *EthMetric) GetFieldBool(key string) (bool, error)

func (*EthMetric) GetFieldInt64 added in v0.26.0

func (obj *EthMetric) GetFieldInt64(key string) (int64, error)

func (*EthMetric) GetFieldKeys added in v0.26.0

func (obj *EthMetric) GetFieldKeys() []string

func (*EthMetric) GetFieldString added in v0.26.0

func (obj *EthMetric) GetFieldString(key string) (string, error)

func (EthMetric) MarshalEasyJSON added in v0.26.0

func (v EthMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EthMetric) MarshalJSON added in v0.26.0

func (v EthMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EthMetric) MatchBool added in v0.26.0

func (obj *EthMetric) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*EthMetric) MatchInt64 added in v0.26.0

func (obj *EthMetric) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*EthMetric) MatchString added in v0.26.0

func (obj *EthMetric) MatchString(key string, predicate getter.StringPredicate) bool

func (*EthMetric) UnmarshalEasyJSON added in v0.26.0

func (v *EthMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EthMetric) UnmarshalJSON added in v0.26.0

func (v *EthMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type IfMetric added in v0.23.0

type IfMetric struct {
	IfInOctets         int64 `json:"IfInOctets,omitempty"`
	IfInUcastPkts      int64 `json:"IfInUcastPkts,omitempty"`
	IfInMulticastPkts  int64 `json:"IfInMulticastPkts,omitempty"`
	IfInBroadcastPkts  int64 `json:"IfInBroadcastPkts,omitempty"`
	IfInDiscards       int64 `json:"IfInDiscards,omitempty"`
	IfInErrors         int64 `json:"IfInErrors,omitempty"`
	IfInUnknownProtos  int64 `json:"IfInUnknownProtos,omitempty"`
	IfOutOctets        int64 `json:"IfOutOctets,omitempty"`
	IfOutUcastPkts     int64 `json:"IfOutUcastPkts,omitempty"`
	IfOutMulticastPkts int64 `json:"IfOutMulticastPkts,omitempty"`
	IfOutBroadcastPkts int64 `json:"IfOutBroadcastPkts,omitempty"`
	IfOutDiscards      int64 `json:"IfOutDiscards,omitempty"`
	IfOutErrors        int64 `json:"IfOutErrors,omitempty"`
}

IfMetric the SFlow Interface counters easyjson:json gendecoder

func (*IfMetric) GetField added in v0.26.0

func (obj *IfMetric) GetField(key string) (interface{}, error)

func (*IfMetric) GetFieldBool added in v0.26.0

func (obj *IfMetric) GetFieldBool(key string) (bool, error)

func (*IfMetric) GetFieldInt64 added in v0.26.0

func (obj *IfMetric) GetFieldInt64(key string) (int64, error)

func (*IfMetric) GetFieldKeys added in v0.26.0

func (obj *IfMetric) GetFieldKeys() []string

func (*IfMetric) GetFieldString added in v0.26.0

func (obj *IfMetric) GetFieldString(key string) (string, error)

func (IfMetric) MarshalEasyJSON added in v0.26.0

func (v IfMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (IfMetric) MarshalJSON added in v0.26.0

func (v IfMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*IfMetric) MatchBool added in v0.26.0

func (obj *IfMetric) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*IfMetric) MatchInt64 added in v0.26.0

func (obj *IfMetric) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*IfMetric) MatchString added in v0.26.0

func (obj *IfMetric) MatchString(key string, predicate getter.StringPredicate) bool

func (*IfMetric) UnmarshalEasyJSON added in v0.26.0

func (v *IfMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*IfMetric) UnmarshalJSON added in v0.26.0

func (v *IfMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type OvsMetric added in v0.23.0

type OvsMetric struct {
	OvsDpNHit      int64 `json:"OvsDpNHit,omitempty"`
	OvsDpNMissed   int64 `json:"OvsDpNMissed,omitempty"`
	OvsDpNLost     int64 `json:"OvsDpNLost,omitempty"`
	OvsDpNMaskHit  int64 `json:"OvsDpNMaskHit,omitempty"`
	OvsDpNFlows    int64 `json:"OvsDpNFlows,omitempty"`
	OvsDpNMasks    int64 `json:"OvsDpNMasks,omitempty"`
	OvsAppFdOpen   int64 `json:"OvsAppFdOpen,omitempty"`
	OvsAppFdMax    int64 `json:"OvsAppFdMax,omitempty"`
	OvsAppConnOpen int64 `json:"OvsAppConnOpen,omitempty"`
	OvsAppConnMax  int64 `json:"OvsAppConnMax,omitempty"`
	OvsAppMemUsed  int64 `json:"OvsAppMemUsed,omitempty"`
	OvsAppMemMax   int64 `json:"OvsAppMemMax,omitempty"`
}

OvsMetric the SFlow ovs counters easyjson:json gendecoder

func (*OvsMetric) GetField added in v0.26.0

func (obj *OvsMetric) GetField(key string) (interface{}, error)

func (*OvsMetric) GetFieldBool added in v0.26.0

func (obj *OvsMetric) GetFieldBool(key string) (bool, error)

func (*OvsMetric) GetFieldInt64 added in v0.26.0

func (obj *OvsMetric) GetFieldInt64(key string) (int64, error)

func (*OvsMetric) GetFieldKeys added in v0.26.0

func (obj *OvsMetric) GetFieldKeys() []string

func (*OvsMetric) GetFieldString added in v0.26.0

func (obj *OvsMetric) GetFieldString(key string) (string, error)

func (OvsMetric) MarshalEasyJSON added in v0.26.0

func (v OvsMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (OvsMetric) MarshalJSON added in v0.26.0

func (v OvsMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*OvsMetric) MatchBool added in v0.26.0

func (obj *OvsMetric) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*OvsMetric) MatchInt64 added in v0.26.0

func (obj *OvsMetric) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*OvsMetric) MatchString added in v0.26.0

func (obj *OvsMetric) MatchString(key string, predicate getter.StringPredicate) bool

func (*OvsMetric) UnmarshalEasyJSON added in v0.26.0

func (v *OvsMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*OvsMetric) UnmarshalJSON added in v0.26.0

func (v *OvsMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SFMetric added in v0.22.0

type SFMetric struct {
	IfMetric
	OvsMetric
	VlanMetric
	EthMetric

	Start int64 `json:"Start,omitempty"`
	Last  int64 `json:"Last,omitempty"`
}

SFMetric the SFlow Counter Samples easyjson:json gendecoder

func (*SFMetric) Add added in v0.22.0

func (sm *SFMetric) Add(m common.Metric) common.Metric

Add sum two metrics and return a new Metrics object

func (*SFMetric) GetField added in v0.22.0

func (obj *SFMetric) GetField(key string) (interface{}, error)

func (*SFMetric) GetFieldBool added in v0.26.0

func (obj *SFMetric) GetFieldBool(key string) (bool, error)

func (*SFMetric) GetFieldInt64 added in v0.22.0

func (obj *SFMetric) GetFieldInt64(key string) (int64, error)

func (*SFMetric) GetFieldKeys added in v0.22.0

func (obj *SFMetric) GetFieldKeys() []string

func (*SFMetric) GetFieldString added in v0.22.0

func (obj *SFMetric) GetFieldString(key string) (string, error)

func (*SFMetric) GetLast added in v0.22.0

func (sm *SFMetric) GetLast() int64

GetLast returns last time

func (*SFMetric) GetStart added in v0.22.0

func (sm *SFMetric) GetStart() int64

GetStart returns start time

func (*SFMetric) IsZero added in v0.22.0

func (sm *SFMetric) IsZero() bool

IsZero returns true if all the values are equal to zero

func (SFMetric) MarshalEasyJSON added in v0.26.0

func (v SFMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SFMetric) MarshalJSON added in v0.26.0

func (v SFMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SFMetric) MatchBool added in v0.26.0

func (obj *SFMetric) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*SFMetric) MatchInt64 added in v0.26.0

func (obj *SFMetric) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*SFMetric) MatchString added in v0.26.0

func (obj *SFMetric) MatchString(key string, predicate getter.StringPredicate) bool

func (*SFMetric) SetLast added in v0.22.0

func (sm *SFMetric) SetLast(last int64)

SetLast set last tome

func (*SFMetric) SetStart added in v0.22.0

func (sm *SFMetric) SetStart(start int64)

SetStart set start time

func (*SFMetric) Split added in v0.22.0

func (sm *SFMetric) Split(cut int64) (common.Metric, common.Metric)

Split splits a metric into two parts

func (*SFMetric) Sub added in v0.22.0

func (sm *SFMetric) Sub(m common.Metric) common.Metric

Sub subtract two metrics and return a new Metrics object

func (*SFMetric) UnmarshalEasyJSON added in v0.26.0

func (v *SFMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SFMetric) UnmarshalJSON added in v0.26.0

func (v *SFMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SFlow added in v0.22.0

type SFlow struct {
	IfMetrics        map[int64]*IfMetric `json:"IfMetrics,omitempty"`
	Metric           *SFMetric           `json:"Metric,omitempty"`
	LastUpdateMetric *SFMetric           `json:"LastUpdateMetric,omitempty"`
}

SFlow all sflow information easyjson:json gendecoder

func (*SFlow) GetField added in v0.22.0

func (obj *SFlow) GetField(key string) (interface{}, error)

func (*SFlow) GetFieldBool added in v0.26.0

func (obj *SFlow) GetFieldBool(key string) (bool, error)

func (*SFlow) GetFieldInt64 added in v0.22.0

func (obj *SFlow) GetFieldInt64(key string) (int64, error)

func (*SFlow) GetFieldKeys added in v0.22.0

func (obj *SFlow) GetFieldKeys() []string

func (*SFlow) GetFieldString added in v0.22.0

func (obj *SFlow) GetFieldString(key string) (string, error)

func (SFlow) MarshalEasyJSON added in v0.26.0

func (v SFlow) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SFlow) MarshalJSON added in v0.26.0

func (v SFlow) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SFlow) MatchBool added in v0.26.0

func (obj *SFlow) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*SFlow) MatchInt64 added in v0.26.0

func (obj *SFlow) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*SFlow) MatchString added in v0.26.0

func (obj *SFlow) MatchString(key string, predicate getter.StringPredicate) bool

func (*SFlow) UnmarshalEasyJSON added in v0.26.0

func (v *SFlow) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SFlow) UnmarshalJSON added in v0.26.0

func (v *SFlow) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type VlanMetric added in v0.23.0

type VlanMetric struct {
	VlanOctets        int64 `json:"VlanOctets,omitempty"`
	VlanUcastPkts     int64 `json:"VlanUcastPkts,omitempty"`
	VlanMulticastPkts int64 `json:"VlanMulticastPkts,omitempty"`
	VlanBroadcastPkts int64 `json:"VlanBroadcastPkts,omitempty"`
	VlanDiscards      int64 `json:"VlanDiscards,omitempty"`
}

VlanMetric the SFlow vlan counters easyjson:json gendecoder

func (*VlanMetric) GetField added in v0.26.0

func (obj *VlanMetric) GetField(key string) (interface{}, error)

func (*VlanMetric) GetFieldBool added in v0.26.0

func (obj *VlanMetric) GetFieldBool(key string) (bool, error)

func (*VlanMetric) GetFieldInt64 added in v0.26.0

func (obj *VlanMetric) GetFieldInt64(key string) (int64, error)

func (*VlanMetric) GetFieldKeys added in v0.26.0

func (obj *VlanMetric) GetFieldKeys() []string

func (*VlanMetric) GetFieldString added in v0.26.0

func (obj *VlanMetric) GetFieldString(key string) (string, error)

func (VlanMetric) MarshalEasyJSON added in v0.26.0

func (v VlanMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (VlanMetric) MarshalJSON added in v0.26.0

func (v VlanMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*VlanMetric) MatchBool added in v0.26.0

func (obj *VlanMetric) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*VlanMetric) MatchInt64 added in v0.26.0

func (obj *VlanMetric) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*VlanMetric) MatchString added in v0.26.0

func (obj *VlanMetric) MatchString(key string, predicate getter.StringPredicate) bool

func (*VlanMetric) UnmarshalEasyJSON added in v0.26.0

func (v *VlanMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*VlanMetric) UnmarshalJSON added in v0.26.0

func (v *VlanMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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