stats

package
Version: v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print() chan struct{}

Print samples

func PrintLimited

func PrintLimited(limit int) chan struct{}

PrintLimited samples

func Process

func Process(processor func(dataPoint)) chan struct{}

Process unreported samples

func ProcessLimited

func ProcessLimited(limit int, processor func(dataPoint)) chan struct{}

ProcessLimited number of unreported samples is restricted by specified limit, the rest os droppped

func RemovePendingOp

func RemovePendingOp(id OpID, status bool) error

RemovePendingOp removes tracking of a completed operation

func Sample

func Sample(timestamp time.Time, duration time.Duration, targetID string, op SampleOp, size int, status bool)

Sample to the cyclic buffer

Types

type OpID

type OpID int

OpID pending operation id

func InsertPendingOp

func InsertPendingOp(timestamp time.Time, targetID string, op SampleOp, size int) OpID

InsertPendingOp starts tracking of a pending operation

type SampleOp

type SampleOp int

SampleOp operation

const (
	// OpNone unitialized operation
	OpNone SampleOp = iota
	// OpRead read from replica
	OpRead
	// OpWrite write to replica
	OpWrite
	// OpPing ping replica
	OpPing
)

func (SampleOp) String

func (op SampleOp) String() string

String conversions

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL