statsclient

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package statsclient is pure Go implementation of VPP stats API client.

Index

Constants

View Source
const (
	// DefaultSocketName is default VPP stats socket file path.
	DefaultSocketName = adapter.DefaultStatsSocket
)

Variables

View Source
var (
	// Debug is global variable that determines debug mode
	Debug = os.Getenv("DEBUG_GOVPP_STATS") != ""

	// Log is global logger
	Log = logger.New()
)
View Source
var (
	MaxWaitInProgress    = time.Millisecond * 100
	CheckDelayInProgress = time.Microsecond * 10
)
View Source
var (
	ErrStatDataLenIncorrect = fmt.Errorf("stat data length incorrect")
)

Functions

This section is empty.

Types

type StatsClient

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

StatsClient is the pure Go implementation for VPP stats API.

func NewStatsClient

func NewStatsClient(sockAddr string) *StatsClient

NewStatsClient returns new VPP stats API client.

func (*StatsClient) Connect

func (c *StatsClient) Connect() error

func (*StatsClient) Disconnect

func (c *StatsClient) Disconnect() error

func (*StatsClient) DumpStats

func (c *StatsClient) DumpStats(patterns ...string) (entries []adapter.StatEntry, err error)

func (*StatsClient) DumpVPCStats added in v0.3.7

func (c *StatsClient) DumpVPCStats(vni ...uint64) (entries []adapter.StatEntry, err error)

func (*StatsClient) GetVPCStats added in v0.3.7

func (c *StatsClient) GetVPCStats(stats []adapter.StatEntry, vni ...uint64) (map[uint64]*VPCCounter, error)

GetVPCStats returns the summed statistical value of each thread

func (*StatsClient) ListStats

func (c *StatsClient) ListStats(patterns ...string) (names []string, err error)

func (*StatsClient) PrepareDir added in v0.3.7

func (c *StatsClient) PrepareDir(patterns ...string) (*adapter.StatDir, error)

func (*StatsClient) UpdateDir added in v0.3.7

func (c *StatsClient) UpdateDir(dir *adapter.StatDir) (err error)

type VPCCounter added in v0.3.7

type VPCCounter struct {
	InBytes    uint64 `json:"in_bytes"`
	InPackets  uint64 `json:"in_packets"`
	OutBytes   uint64 `json:"out_bytes"`
	OutPackets uint64 `json:"out_packets"`
}

Jump to

Keyboard shortcuts

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