ax(database): add usage-example comment to GetHashrateStats

GetHashrateStats had no comment at all — bare exported function.
AX Principle 2 requires comments as usage examples, not prose.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 14:17:46 +01:00
parent 5bfffbdec9
commit 8a23b0efca
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -125,6 +125,9 @@ type HashrateStats struct {
LastSeen time.Time `json:"lastSeen"`
}
// GetHashrateStats retrieves aggregated statistics for a specific miner.
// stats, err := database.GetHashrateStats("xmrig")
// if stats != nil { log.Printf("avg: %d", stats.AverageRate) }
func GetHashrateStats(minerName string) (*HashrateStats, error) {
databaseMutex.RLock()
defer databaseMutex.RUnlock()