Documentation
¶
Index ¶
- Variables
- func SFMetadataDecoder(raw json.RawMessage) (common.Getter, error)
- type Agent
- type AgentAllocator
- type SFMetric
- func (sm *SFMetric) Add(m common.Metric) common.Metric
- func (sm *SFMetric) GetField(key string) (interface{}, error)
- func (sm *SFMetric) GetFieldInt64(field string) (int64, error)
- func (sm *SFMetric) GetFieldKeys() []string
- func (sm *SFMetric) GetFieldString(key string) (string, error)
- 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
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Agent ¶ added in v0.22.0
type Agent struct { common.RWMutex UUID string Addr string Port int FlowTable *flow.Table Conn *net.UDPConn BPFFilter string HeaderSize uint32 Graph *graph.Graph Node *graph.Node }
Agent describes SFlow agent probe
func NewAgent ¶ added in v0.22.0
func NewAgent(u string, a *common.ServiceAddress, 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.22.0
GetTarget returns the current used connection
type AgentAllocator ¶ added in v0.22.0
AgentAllocator describes an SFlow agent allocator to manage multiple SFlow agent probe
func NewAgentAllocator ¶ added in v0.22.0
func NewAgentAllocator() (*AgentAllocator, error)
NewAgentAllocator creates a new sFlow agent allocator
func (*AgentAllocator) Alloc ¶ added in v0.22.0
func (a *AgentAllocator) Alloc(uuid string, ft *flow.Table, bpfFilter string, headerSize uint32, addr *common.ServiceAddress, n *graph.Node, g *graph.Graph) (agent *Agent, _ error)
Alloc allocates a new sFlow agent
func (*AgentAllocator) Release ¶ added in v0.22.0
func (a *AgentAllocator) Release(uuid string)
Release a sFlow agent
func (*AgentAllocator) ReleaseAll ¶ added in v0.22.0
func (a *AgentAllocator) ReleaseAll()
ReleaseAll sFlow agents
type SFMetric ¶ added in v0.22.0
type SFMetric struct { Start int64 `json:"Start,omitempty"` Last int64 `json:"Last,omitempty"` 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"` 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"` 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"` }
SFMetric the SFlow Counter Samples easyjson:json
func (*SFMetric) Add ¶ added in v0.22.0
Add sum two metrics and return a new Metrics object
func (*SFMetric) GetField ¶ added in v0.22.0
GetField implements Getter interface
func (*SFMetric) GetFieldInt64 ¶ added in v0.22.0
GetFieldInt64 implements Getter and Metrics interfaces
func (*SFMetric) GetFieldKeys ¶ added in v0.22.0
GetFieldKeys implements Getter and Metrics interfaces
func (*SFMetric) GetFieldString ¶ added in v0.22.0
GetFieldString implements Getter interface
func (*SFMetric) GetLast ¶ added in v0.22.0
GetLast returns last time
func (*SFMetric) GetStart ¶ added in v0.22.0
GetStart returns start time
func (*SFMetric) IsZero ¶ added in v0.22.0
IsZero returns true if all the values are equal to zero
func (*SFMetric) SetLast ¶ added in v0.22.0
SetLast set last tome
func (*SFMetric) SetStart ¶ added in v0.22.0
SetStart set start time
func (*SFMetric) Split ¶ added in v0.22.0
Split splits a metric into two parts
type SFlow ¶ added in v0.22.0
type SFlow struct { Counters []layers.SFlowCounterSample `json:"Counters,omitempty"` Metric *SFMetric `json:"Metric,omitempty"` LastUpdateMetric *SFMetric `json:"LastUpdateMetric,omitempty"` }
SFlow all sflow information
func (*SFlow) GetField ¶ added in v0.22.0
GetField implements Getter interface
func (*SFlow) GetFieldInt64 ¶ added in v0.22.0
GetFieldInt64 implements Getter interface
func (*SFlow) GetFieldKeys ¶ added in v0.22.0
GetFieldKeys implements Getter interface
Source Files
¶
- agent.go
- sflowmetric.go