Documentation ¶
Index ¶
- Variables
- func SFMetadataDecoder(raw json.RawMessage) (common.Getter, error)
- type Agent
- type AgentAllocator
- type EthMetric
- type IfMetric
- type OvsMetric
- type SFMetric
- func (sm *SFMetric) Add(m common.Metric) common.Metric
- func (sm *SFMetric) GetLast() int64
- func (sm *SFMetric) GetStart() int64
- func (sm *SFMetric) IsZero() bool
- func (sm *SFMetric) SetLast(last int64)
- func (sm *SFMetric) SetStart(start int64)
- func (sm *SFMetric) Split(cut int64) (common.Metric, common.Metric)
- func (sm *SFMetric) Sub(m common.Metric) common.Metric
- type SFlow
- type VlanMetric
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAgentAlreadyAllocated error agent already allocated for this uuid ErrAgentAlreadyAllocated = errors.New("agent already allocated for this uuid") )
Functions ¶
func SFMetadataDecoder ¶
func SFMetadataDecoder(raw json.RawMessage) (common.Getter, error)
SFMetadataDecoder implements a json message raw decoder
Types ¶
type Agent ¶
type Agent struct { common.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 ¶
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
type AgentAllocator ¶
AgentAllocator describes an SFlow agent allocator to manage multiple SFlow agent probe
func NewAgentAllocator ¶
func NewAgentAllocator() (*AgentAllocator, error)
NewAgentAllocator creates a new sFlow agent allocator
func (*AgentAllocator) Alloc ¶
func (a *AgentAllocator) Alloc(uuid string, ft *flow.Table, bpfFilter string, headerSize uint32, addr *common.ServiceAddress, n *graph.Node, g *graph.Graph) (*Agent, error)
Alloc allocates a new sFlow agent
func (*AgentAllocator) Release ¶
func (a *AgentAllocator) Release(uuid string)
Release a sFlow agent
type EthMetric ¶
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
type IfMetric ¶
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
type OvsMetric ¶
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
type SFMetric ¶
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
type SFlow ¶
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
type VlanMetric ¶
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