From 8a23b0efca4e0d4b1e4dbfbc3962e27f160a091e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 14:17:46 +0100 Subject: [PATCH] ax(database): add usage-example comment to GetHashrateStats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetHashrateStats had no comment at all — bare exported function. AX Principle 2 requires comments as usage examples, not prose. Co-Authored-By: Charon --- pkg/database/hashrate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/database/hashrate.go b/pkg/database/hashrate.go index 5c425a8..0f3d071 100644 --- a/pkg/database/hashrate.go +++ b/pkg/database/hashrate.go @@ -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()