wgengine: flesh out some docs

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-02-11 15:21:24 -08:00
committed by Brad Fitzpatrick
parent 490e586eac
commit 819daf10e2
6 changed files with 68 additions and 24 deletions

View File

@ -11,7 +11,10 @@ import (
"tailscale.com/logger"
)
func RusagePrefixLog(logf logger.Logf) func(f string, argv ...interface{}) {
// RusagePrefixLog returns a Logf func wrapping the provided logf func that adds
// a prefixed log message to each line with the current binary memory usage
// and max RSS.
func RusagePrefixLog(logf logger.Logf) logger.Logf {
return func(f string, argv ...interface{}) {
var m runtime.MemStats
runtime.ReadMemStats(&m)