collector

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Add(*Result) error
	Inc()
	Start() Collector
	Stop()
	Stats() Stats
}

The Collector is informed of any new requests coming in and of replication attempt, it stores these values and exposes stats of a shadowing run.

type Config

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

Config contains the internal configuration for a worker

func New

func New(buffer int) *Config

New returns a new Reporter

func (*Config) Add

func (c *Config) Add(res *Result) error

Add adds a new result to the processing channel, errors if the channel is full

func (*Config) Inc

func (c *Config) Inc()

Inc increments the 'total processed' counter.

func (*Config) Start

func (c *Config) Start() Collector

Start begins consuming from the channel of results populated by Add

func (*Config) Stats

func (c *Config) Stats() Stats

Stats returns the current aggregate results of this shadowing run

func (*Config) Stop

func (c *Config) Stop()

Stop closes and drains the channel of results

type Result

type Result struct {
	Timestamp  time.Time
	Status     int
	DurationMs uint64
	Err        error
}

The Result struct contains information related to the status of a single replication attempt

type Stats

type Stats struct {
	ProcessedTotal    uint64
	ReplicatedTotal   uint64
	ErroredTotal      uint64
	TimeoutErrorTotal uint64
	ServerErrorTotal  uint64
	ServerOKTotal     uint64
	TotalDurationMs   uint64
}

Stats contains stats around the current reporting run

Jump to

Keyboard shortcuts

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