import "github.com/golang/go/src/expvar"
Package expvar provides a standardized interface to public variables, such as operation counters in servers. It exposes these variables via HTTP at /debug/vars in JSON format.
Operations to set or modify these public variables are atomic.
In addition to adding the HTTP handler, this package registers the following variables:
cmdline os.Args memstats runtime.Memstats
The package is sometimes only imported for the side effect of registering its HTTP handler and the above variables. To use it this way, link this package into your program:
import _ "expvar"
Do calls f for each exported variable. The global variable map is locked during the iteration, but existing entries may be concurrently updated.
Handler returns the expvar HTTP Handler.
This is only needed to install the handler in a non-standard location.
Publish declares a named exported variable. This should be called from a package's init function when it creates its Vars. If the name is already registered then this will log.Panic.
Float is a 64-bit float variable that satisfies the Var interface.
Add adds delta to v.
Set sets v to value.
Func implements Var by calling the function and formatting the returned value using JSON.
Int is a 64-bit integer variable that satisfies the Var interface.
KeyValue represents a single entry in a Map.
Map is a string-to-Var map variable that satisfies the Var interface.
Add adds delta to the *Int value stored under the given map key.
AddFloat adds delta to the *Float value stored under the given map key.
Delete deletes the given key from the map.
Do calls f for each entry in the map. The map is locked during the iteration, but existing entries may be concurrently updated.
Init removes all keys from the map.
String is a string variable, and satisfies the Var interface.
String implements the Var interface. To get the unquoted string use Value.
type Var interface { // String returns a valid JSON value for the variable. // Types with String methods that do not return valid JSON // (such as time.Time) must not be used as a Var. String() string }
Var is an abstract type for all exported variables.
Get retrieves a named exported variable. It returns nil if the name has not been registered.
Package expvar imports 12 packages (graph). Updated 2019-08-20. Refresh now. Tools for package owners.