Show stats by worker in daily stats

This commit is contained in:
Pijus Kamandulis
2025-07-04 19:04:24 +03:00
parent 11cc168b3a
commit b3c89a01d0
2 changed files with 62 additions and 6 deletions

View File

@@ -295,6 +295,9 @@ func GetDailyStats(db *clover.DB, date time.Time) (*models.DailyStats, error) {
}
for workerName, workerShares := range sharesByWorker {
workerHashrate := helpers.CalculateAverageHashrate(workerShares)
sort.Slice(workerShares, func(i, j int) bool {
return workerShares[i].SDiff > workerShares[j].SDiff
})
workerTopShare := workerShares[0] // Already sorted by SDiff
stats.Workers[workerName] = models.WorkerDailyStats{