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 ¶
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) (common.Getter, error)
SFMetadataDecoder implements a json message raw decoder
Types ¶
type Agent ¶ added in v0.21.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.21.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
type AgentAllocator ¶ added in v0.21.0
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 *common.ServiceAddress, n *graph.Node, g *graph.Graph) (agent *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 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) 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
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) GetFieldInt64 ¶ added in v0.22.0
GetFieldInt64 implements Getter interface
func (*SFlow) GetFieldKeys ¶ added in v0.22.0
GetFieldKeys implements Getter interface