pbnjay / memory

A go function to report total system memory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add Reporter utility

pbnjay opened this issue · comments

It would be useful to get notifications when long-running code uses too much memory. Then it could dynamically tune parallelism to ensure it doesn't overcommit.

Something similar to this interface would likely work:

type ReporterFunc func(percent float64)
func NewReporter(interval time.Duration, reporter ReporterFunc)