expvar: RemoveAll is used for tests only #27555
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?go version go1.11 darwin/amd64
go/src/expvar/expvar_test.go
Lines 21 to 30 in 3e5b5d6
The comment for
expvar.RemoveAll()
saysThis is for tests only.
So at the very least this function should be made private.On the other hand, it would be useful to be able to remove a metric and perhaps "Reset" all metric variables. I understand that the underlying
sync.Map
is optimized for many reads and infrequent writes but we could add godoc to make it clear that the "Reset" or "RemoveAll" would be expensive and should be used infrequently.The text was updated successfully, but these errors were encountered: