vppcalls

package
v2.5.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FallbackToCli defines wether should telemetry handler
	// fallback to parsing stats from CLI output.
	FallbackToCli = true
)
View Source
var Versions = map[string]HandlerVersion{}

Functions

func SplitErrorName

func SplitErrorName(str string) (node, reason string)

Types

type BuffersInfo

type BuffersInfo struct {
	Items []BuffersItem `json:"items"`
}

BuffersInfo contains values returned from 'show buffers'

func (*BuffersInfo) GetItems

func (i *BuffersInfo) GetItems() []BuffersItem

GetItems is safe getter for items,

type BuffersItem

type BuffersItem struct {
	ThreadID uint   `json:"thread_id"`
	Name     string `json:"name"`
	Index    uint   `json:"index"`
	Size     uint64 `json:"size"`
	Alloc    uint64 `json:"alloc"`
	Free     uint64 `json:"free"`
	NumAlloc uint64 `json:"num_alloc"`
	NumFree  uint64 `json:"num_free"`
}

BuffersItem represents single buffers item

type HandlerVersion

type HandlerVersion struct {
	Msgs []govppapi.Message
	New  func(govppapi.Channel) TelemetryVppAPI
}

type MemoryInfo

type MemoryInfo struct {
	Threads []MemoryThread `json:"threads"`
}

MemoryInfo contains memory thread info.

func (*MemoryInfo) GetThreads

func (i *MemoryInfo) GetThreads() []MemoryThread

GetThreads is safe getter for threads,

type MemoryThread

type MemoryThread struct {
	ID        uint   `json:"id"`
	Name      string `json:"name"`
	Size      uint64 `json:"size"`
	Objects   uint64 `json:"objects"`
	Used      uint64 `json:"used"`
	Total     uint64 `json:"total"`
	Free      uint64 `json:"free"`
	Reclaimed uint64 `json:"reclaimed"`
	Overhead  uint64 `json:"overhead"`
	Pages     uint64 `json:"pages"`
	PageSize  uint64 `json:"page_size"`
}

MemoryThread represents single thread memory counters

type NodeCounter

type NodeCounter struct {
	Value uint64 `json:"value"`
	Node  string `json:"node"`
	Name  string `json:"name"`
}

NodeCounter represents single node counter

type NodeCounterInfo

type NodeCounterInfo struct {
	Counters []NodeCounter `json:"counters"`
}

NodeErrorCounterInfo contains node counters info.

func (*NodeCounterInfo) GetCounters

func (i *NodeCounterInfo) GetCounters() []NodeCounter

GetCounters is safe getter for counters,

type RuntimeInfo

type RuntimeInfo struct {
	Threads []RuntimeThread `json:"threads"`
}

RuntimeInfo contains values returned from 'show runtime'

func (*RuntimeInfo) GetThreads

func (i *RuntimeInfo) GetThreads() []RuntimeThread

GetThreads is safe getter for threads.

type RuntimeItem

type RuntimeItem struct {
	Index          uint    `json:"index"`
	Name           string  `json:"name"`
	State          string  `json:"state"`
	Calls          uint64  `json:"calls"`
	Vectors        uint64  `json:"vectors"`
	Suspends       uint64  `json:"suspends"`
	Clocks         float64 `json:"clocks"`
	VectorsPerCall float64 `json:"vectors_per_call"`
}

RuntimeItem represents single runtime item

type RuntimeThread

type RuntimeThread struct {
	ID                  uint          `json:"id"`
	Name                string        `json:"name"`
	Time                float64       `json:"time"`
	AvgVectorsPerNode   float64       `json:"avg_vectors_per_node"`
	LastMainLoops       uint64        `json:"last_main_loops"`
	VectorsPerMainLoop  float64       `json:"vectors_per_main_loop"`
	VectorLengthPerNode float64       `json:"vector_length_per_node"`
	VectorRatesIn       float64       `json:"vector_rates_in"`
	VectorRatesOut      float64       `json:"vector_rates_out"`
	VectorRatesDrop     float64       `json:"vector_rates_drop"`
	VectorRatesPunt     float64       `json:"vector_rates_punt"`
	Items               []RuntimeItem `json:"items"`
}

RuntimeThread represents single runtime thread

type TelemetryStats

type TelemetryStats struct {
	// contains filtered or unexported fields
}

func NewTelemetryVppStats

func NewTelemetryVppStats(stats govppapi.StatsProvider) *TelemetryStats

func (*TelemetryStats) GetBuffersInfo

func (h *TelemetryStats) GetBuffersInfo(ctx context.Context) (*BuffersInfo, error)

GetBuffersInfo retrieves buffers info from VPP.

func (*TelemetryStats) GetInterfaceStats

func (h *TelemetryStats) GetInterfaceStats(context.Context) (*govppapi.InterfaceStats, error)

func (*TelemetryStats) GetMemory

func (h *TelemetryStats) GetMemory(ctx context.Context) (*MemoryInfo, error)

GetMemory retrieves `show memory` info.

func (*TelemetryStats) GetNodeCounters

func (h *TelemetryStats) GetNodeCounters(ctx context.Context) (*NodeCounterInfo, error)

GetNodeCounters retrieves node counters info.

func (*TelemetryStats) GetRuntimeInfo

func (h *TelemetryStats) GetRuntimeInfo(ctx context.Context) (*RuntimeInfo, error)

GetRuntimeInfo retrieves how runtime info.

func (*TelemetryStats) GetSystemStats

func (h *TelemetryStats) GetSystemStats(context.Context) (*govppapi.SystemStats, error)

type TelemetryVppAPI

type TelemetryVppAPI interface {
	GetSystemStats(context.Context) (*govppapi.SystemStats, error)
	GetMemory(context.Context) (*MemoryInfo, error)
	GetNodeCounters(context.Context) (*NodeCounterInfo, error)
	GetRuntimeInfo(context.Context) (*RuntimeInfo, error)
	GetBuffersInfo(context.Context) (*BuffersInfo, error)
	GetInterfaceStats(context.Context) (*govppapi.InterfaceStats, error)
}

TelemetryVppAPI provides API for retrieving telemetry data from VPP.

func CompatibleTelemetryHandler

func CompatibleTelemetryHandler(ch govppapi.Channel, stats govppapi.StatsProvider) TelemetryVppAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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