Package stats is a wrapper for expvar. It addtionally exports new types that can be used to track performance. It also provides a callback hook that allows a program to export the variables using methods other than /debug/vars. All variables support a String function that is expected to return a JSON representation of the variable. Any function named Add will add the specified number to the variable. Any function named Counts returns a map of counts that can be used by Rates to track rates over time.