stats

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DiscoverSentStat = iota
	InfoSentStat
	RequestSentStat
	DeclineSentStat
	ReleaseSentStat

	OfferReceivedStat
	AckReceivedStat
	NakReceivedStat

	ArpReplySentStat
	ArpRequestReceivedStat
)

Variables

This section is empty.

Functions

func AddStatter

func AddStatter(s string, f func(StatsInitParams) Stats) error

Types

type Stat

type Stat struct {
	Name                string  `json:"stat_name"`
	Value               int     `json:"stat_value"`
	PreviousTickerValue int     `json:"stat_previous_ticker_value"`
	RatePerSecond       float64 `json:"stat_rate_per_second"`
}

type StatValue

type StatValue int

type Stats

type Stats interface {
	AddStat(s StatValue) bool
	Init() error
	Run()
	String() string
	Stop() error
	DeInit() error
}

func New

func New(o config.HammerConfig, logFunc func(string) bool, errFunc func(error) bool) (Stats, error)

func NewStatsDhcpV4

func NewStatsDhcpV4(sip StatsInitParams) Stats

type StatsInitParams

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

type StatsV4

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

func (*StatsV4) AddStat

func (s *StatsV4) AddStat(sv StatValue) bool

func (*StatsV4) DeInit

func (s *StatsV4) DeInit() error

func (*StatsV4) Init

func (s *StatsV4) Init() error

func (*StatsV4) Run

func (s *StatsV4) Run()

func (*StatsV4) Stop

func (s *StatsV4) Stop() error

func (*StatsV4) String

func (s *StatsV4) String() string

Jump to

Keyboard shortcuts

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