metrics

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IngestRate

type IngestRate struct {
	AvgMhPerAd int64
	MhPerSec   int64
	ProviderID peer.ID
}

type Metrics

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

func New

func New(listenAddr string, pc *pcache.ProviderCache) *Metrics

func (*Metrics) NotifyProviderErrorCleared

func (m *Metrics) NotifyProviderErrorCleared(ctx context.Context, err error)

func (*Metrics) NotifyProviderErrored

func (m *Metrics) NotifyProviderErrored(ctx context.Context, err error)

func (*Metrics) Shutdown

func (m *Metrics) Shutdown() error

func (*Metrics) Start

func (m *Metrics) Start(slowRate, nSlowest int) error

func (*Metrics) UpdateIngestRates

func (m *Metrics) UpdateIngestRates(slowRates []*IngestRate, slowCount int, avg, fastest, slowest int64)

func (*Metrics) UpdateProviderDistanceBuckets

func (m *Metrics) UpdateProviderDistanceBuckets(ctx context.Context, small, medium, large, totalDist int64)

type SortableRates

type SortableRates []*IngestRate

func (SortableRates) Len

func (r SortableRates) Len() int

func (SortableRates) Less

func (r SortableRates) Less(i, j int) bool

func (SortableRates) Swap

func (r SortableRates) Swap(i, j int)

Jump to

Keyboard shortcuts

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