relaystats

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileNetStats

func NewFileNetStats() *file.NetStats

Initialise FileNetstats

func Save

func Save(ns NetStats, sfile *file.NetStats) bool

Save to file format

Types

type NetStats

type NetStats struct {
	ContractStats map_counter.Map
	CreatedAt     int64
}

func Load

func Load(sfile *file.NetStats, initMap func() map_counter.Map) (ns NetStats)

Load from file format

func NewNetStats

func NewNetStats(initMap func() map_counter.Map) NetStats

Initialise Netstats

func (NetStats) Enabled

func (ns NetStats) Enabled() bool

Return if NetStats have been initialised

func (NetStats) GetNextReset

func (ns NetStats) GetNextReset(d time.Duration) (time.Time, bool)

Returns time next Reset in the future, and if NS should have been already reset

func (*NetStats) Reset

func (ns *NetStats) Reset() (map[string]uint64, bool)

Reset NetStats

func (*NetStats) ResetWithDate

func (ns *NetStats) ResetWithDate(t time.Time) (m map[string]uint64, ok bool)

Reset NetStats with date

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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