Documentation
¶
Index ¶
- Constants
- Variables
- func TimeToPeriod(t time.Time) uint64
- type FarmData
- func (fd *FarmData) AddClaim(status string, claim smartpool.Claim, t time.Time)
- func (fd *FarmData) AddHashrate(rig smartpool.Rig, hashrate hexutil.Uint64, id common.Hash, t time.Time)
- func (fd *FarmData) AddShare(rig smartpool.Rig, status string, share smartpool.Share, t time.Time)
- func (fd *FarmData) ShareRestored(noShares uint64)
- type OverallFarmData
- type OverallRigData
- type PeriodFarmData
- type PeriodRigData
- type RigData
- type StatRecorder
- func (sr *StatRecorder) FarmStat(start uint64, end uint64) interface{}
- func (sr *StatRecorder) OverallFarmStat() interface{}
- func (sr *StatRecorder) OverallRigStat(rig smartpool.Rig) interface{}
- func (sr *StatRecorder) Persist(storage smartpool.PersistentStorage) error
- func (sr *StatRecorder) RecordClaim(status string, claim smartpool.Claim)
- func (sr *StatRecorder) RecordHashrate(hashrate hexutil.Uint64, id common.Hash, rig smartpool.Rig)
- func (sr *StatRecorder) RecordShare(status string, share smartpool.Share, rig smartpool.Rig)
- func (sr *StatRecorder) RigStat(rig smartpool.Rig, start, end uint64) interface{}
- func (sr *StatRecorder) ShareRestored(noShares uint64)
Constants ¶
View Source
const STATRECORDER_FILE string = "stat_recorder"
Variables ¶
View Source
var BaseTimePeriod int64 = 60
Functions ¶
func TimeToPeriod ¶
Types ¶
type FarmData ¶
type FarmData struct {
Datas map[uint64]*PeriodFarmData
*OverallFarmData
}
func NewFarmData ¶
func NewFarmData() *FarmData
func (*FarmData) AddHashrate ¶
func (*FarmData) ShareRestored ¶
type OverallFarmData ¶
type OverallFarmData struct {
LastBlock time.Time `json:"last_block"`
TotalValidDifficulty *big.Int `json:"-"`
LastSubmittedClaim time.Time `json:"last_submitted_claim"`
LastAcceptedClaim time.Time `json:"last_accepted_claim"`
LastRejectedClaim time.Time `json:"last_rejected_claim"`
SubmittedClaim uint64 `json:"total_submitted_claim"`
AcceptedClaim uint64 `json:"total_accepted_claim"`
RejectedClaim uint64 `json:"total_rejected_claim"`
TotalHashrate *big.Int `json:"-"`
NoHashrateSubmission uint64 `json:"-"`
AverageReportedHashrate *big.Int `json:"reported_hashrate"`
AverageEffectiveHashrate *big.Int `json:"effective_hashrate"`
Rigs map[string]bool `json:"rigs"`
BlockFound uint64 `json:"total_block_found"`
PendingShare uint64 `json:"pending_share"`
// A share is considered as abandoned when the claim it belongs to was
// rejected by the contract or it is discarded while being restored
// from last running session because of configuration changes
StartTime time.Time `json:"start_time"`
}
type OverallRigData ¶
type OverallRigData struct {
LastBlock time.Time `json:"last_block"`
TotalValidDifficulty *big.Int `json:"total_accepted_difficulty"`
TotalHashrate *big.Int `json:"total_hashrate"`
NoHashrateSubmission uint64 `json:"no_hashrate_submission"`
AverageReportedHashrate *big.Int `json:"average_reported_hashrate"`
AverageEffectiveHashrate *big.Int `json:"average_effective_hashrate"`
BlockFound uint64 `json:"total_block_found"`
StartTime time.Time `json:"start_time"`
}
type PeriodFarmData ¶
type PeriodFarmData struct {
TotalValidDifficulty *big.Int `json:"-"`
SubmittedClaim uint64 `json:"submitted_claim"`
AcceptedClaim uint64 `json:"accepted_claim"`
RejectedClaim uint64 `json:"rejected_claim"`
TotalHashrate *big.Int `json:"-"`
NoHashrateSubmission uint64 `json:"-"`
AverageReportedHashrate *big.Int `json:"reported_hashrate"`
AverageEffectiveHashrate *big.Int `json:"effective_hashrate"`
Rigs map[string]bool `json:"rigs"`
BlockFound uint64 `json:"block_found"`
TimePeriod uint64 `json:"time_period"`
StartTime time.Time `json:"start_time"`
}
func NewPeriodFarmData ¶
func NewPeriodFarmData(timePeriod uint64) *PeriodFarmData
type PeriodRigData ¶
type PeriodRigData struct {
TotalValidDifficulty *big.Int `json:"-"`
TotalHashrate *big.Int `json:"-"`
NoHashrateSubmission uint64 `json:"-"`
AverageReportedHashrate *big.Int `json:"reported_hashrate"`
AverageEffectiveHashrate *big.Int `json:"effective_hashrate"`
BlockFound uint64 `json:"block_found"`
TimePeriod uint64 `json:"time_period"`
StartTime time.Time `json:"start_time"`
}
func NewPeriodRigData ¶
func NewPeriodRigData(timePeriod uint64) *PeriodRigData
type RigData ¶
type RigData struct {
Datas map[uint64]*PeriodRigData
*OverallRigData
}
func NewRigData ¶
func NewRigData() *RigData
func (*RigData) AddHashrate ¶
type StatRecorder ¶
type StatRecorder struct {
RigDatas map[string]*RigData
FarmData *FarmData
// contains filtered or unexported fields
}
func NewStatRecorder ¶
func NewStatRecorder(storage smartpool.PersistentStorage) *StatRecorder
func (*StatRecorder) FarmStat ¶
func (sr *StatRecorder) FarmStat(start uint64, end uint64) interface{}
func (*StatRecorder) OverallFarmStat ¶
func (sr *StatRecorder) OverallFarmStat() interface{}
func (*StatRecorder) OverallRigStat ¶
func (sr *StatRecorder) OverallRigStat(rig smartpool.Rig) interface{}
func (*StatRecorder) Persist ¶
func (sr *StatRecorder) Persist(storage smartpool.PersistentStorage) error
func (*StatRecorder) RecordClaim ¶
func (sr *StatRecorder) RecordClaim(status string, claim smartpool.Claim)
func (*StatRecorder) RecordHashrate ¶
func (*StatRecorder) RecordShare ¶
func (*StatRecorder) RigStat ¶
func (sr *StatRecorder) RigStat(rig smartpool.Rig, start, end uint64) interface{}
func (*StatRecorder) ShareRestored ¶
func (sr *StatRecorder) ShareRestored(noShares uint64)
Click to show internal directories.
Click to hide internal directories.