stats

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PingIntervalInSeconds
	PingIntervalInSeconds = 5
)

Variables

This section is empty.

Functions

func CalculateNodeStatisticsForInterval

func CalculateNodeStatisticsForInterval(
	repos repositories.Repos,
	nodeId string,
	intervalStart time.Time,
	intervalEnd time.Time,
) (*models.NodeStatsDetails, error)

CalculateNodeStatisticsForInterval calculates stats for specific node for interval, specified with arguments intervalStart and intervalEnd, as models.NodeStatsDetails where node is specified with argument nodeId

func CalculateNodeStatisticsFromLastPayout

func CalculateNodeStatisticsFromLastPayout(repos repositories.Repos, nodeId string, intervalEnd time.Time) (*models.NodeStatsDetails, error)

CalculateNodeStatisticsFromLastPayout calculates stats for specific node for interval, that starts from last recorded payout until now, as models.NodeStatsDetails where node is specified with argument nodeId

func CalculateStatisticsForInterval

func CalculateStatisticsForInterval(
	repos repositories.Repos,
	intervalStart time.Time,
	intervalEnd time.Time,
) (map[string]models.NodeStatsDetails, error)

CalculateStatisticsForInterval calculates stats for all nodes for interval, specified with arguments intervalStart and intervalEnd, as map[string]models.NodeStatsDetails where keys represent node payout address

func CalculateStatisticsFromLastPayout

func CalculateStatisticsFromLastPayout(repos repositories.Repos, intervalEnd time.Time) (map[string]models.NodeStatsDetails, error)

CalculateStatisticsFromLastPayout calculates stats for all nodes for interval, that starts from last recorded payout until now, as map[string]models.NodeStatsDetails where keys represent node payout address

func CalculateTotalPingsForNode

func CalculateTotalPingsForNode(
	repos repositories.Repos,
	nodeId string,
	intervalStart time.Time,
	intervalEnd time.Time,
) (float64, error)

func GetIntervalFromLastPayout

func GetIntervalFromLastPayout(repos repositories.Repos) (*time.Time, error)

GetIntervalFromLastPayout returns interval from last recorded payout until now as (intervalStart, intervalEnd, err)

Types

This section is empty.

Jump to

Keyboard shortcuts

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