Source File
expvar.go
Belonging Package
expvar
package expvar
import (
)
String() string
}
type Float struct {
f uint64
}
func ( *Float) () float64 {
return math.Float64frombits(atomic.LoadUint64(&.f))
}
func ( *Float) () string {
return strconv.FormatFloat(
math.Float64frombits(atomic.LoadUint64(&.f)), 'g', -1, 64)
}
func ( *Float) ( float64) {
for {
:= atomic.LoadUint64(&.f)
:= math.Float64frombits()
:= +
:= math.Float64bits()
if atomic.CompareAndSwapUint64(&.f, , ) {
return
}
}
}
func ( *Float) ( float64) {
atomic.StoreUint64(&.f, math.Float64bits())
}
func ( func(KeyValue)) {
varKeysMu.RLock()
defer varKeysMu.RUnlock()
for , := range varKeys {
, := vars.Load()
(KeyValue{, .(Var)})
}
}
func ( http.ResponseWriter, *http.Request) {
.Header().Set("Content-Type", "application/json; charset=utf-8")
fmt.Fprintf(, "{\n")
:= true
Do(func( KeyValue) {
if ! {
fmt.Fprintf(, ",\n")
}
= false
fmt.Fprintf(, "%q: %s", .Key, .Value)
})
fmt.Fprintf(, "\n}\n")
}
func () http.Handler {
return http.HandlerFunc(expvarHandler)
}
func () interface{} {
return os.Args
}
func () interface{} {
:= new(runtime.MemStats)
runtime.ReadMemStats()
return *
}
func () {
http.HandleFunc("/debug/vars", expvarHandler)
Publish("cmdline", Func(cmdline))
Publish("memstats", Func(memstats))
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |