Implement daily stats
This commit is contained in:
@@ -36,6 +36,20 @@ type TimeWindowHighShare struct {
|
||||
Time string `json:"share_time"` // Time of the highest share
|
||||
}
|
||||
|
||||
type DailyStats struct {
|
||||
Date string `json:"date"` // Format: "2006-01-02" in UTC
|
||||
ShareCount int `json:"sharecount"` // Total shares submitted that day
|
||||
TopShare ShareLog `json:"topshare"` // Highest share (by SDiff)
|
||||
PoolHashrate float64 `json:"poolhashrate"` // In H/s (averaged)
|
||||
Workers map[string]WorkerDailyStats `json:"workers"` // key = workername
|
||||
}
|
||||
|
||||
type WorkerDailyStats struct {
|
||||
TopShare ShareLog `json:"topshare"` // Highest share by this worker
|
||||
Hashrate float64 `json:"hashrate"` // avg hashrate in H/s
|
||||
Shares int `json:"shares"` // shares submitted
|
||||
}
|
||||
|
||||
// ParseCreateDate can be used to convert ShareLog.CreateDate to time.Time
|
||||
func (s *ShareLog) ParseCreateDate() (time.Time, error) {
|
||||
var sec, nsec int64
|
||||
|
||||
Reference in New Issue
Block a user