Documentation ¶
Index ¶
- Constants
- func CalculateNodeStatisticsForInterval(repos repositories.Repos, nodeId string, intervalStart time.Time, ...) (*models.NodeStatsDetails, error)
- func CalculateNodeStatisticsFromLastPayout(repos repositories.Repos, nodeId string, intervalEnd time.Time) (*models.NodeStatsDetails, error)
- func CalculateStatisticsForInterval(repos repositories.Repos, intervalStart time.Time, intervalEnd time.Time) (map[string]models.NodeStatsDetails, error)
- func CalculateStatisticsFromLastPayout(repos repositories.Repos, intervalEnd time.Time) (map[string]models.NodeStatsDetails, error)
- func CalculateTotalPingsForNode(repos repositories.Repos, nodeId string, intervalStart time.Time, ...) (float64, error)
- func GetIntervalFromLastPayout(repos repositories.Repos) (*time.Time, error)
Constants ¶
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 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.