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:
parent
5bfffbdec9
commit
8a23b0efca
1 changed files with 3 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue