1
0
mirror of https://github.com/divan/expvarmon.git synced 2025-04-25 13:48:54 +08:00
expvarmon/expvars.go

31 lines
517 B
Go
Raw Normal View History

2015-04-21 12:51:01 +03:00
package main
import (
2015-05-01 00:47:11 +03:00
//"io"
2015-04-21 12:51:01 +03:00
"runtime"
)
const ExpvarsUrl = "/debug/vars"
2015-04-25 15:54:17 +03:00
// ExpvarsSource implements Source interface for retrieving Expvars.
2015-04-21 12:51:01 +03:00
type ExpvarsSource struct {
Ports []string
}
type Expvars map[string]Expvar
type Expvar struct {
2015-04-25 15:54:17 +03:00
MemStats *runtime.MemStats `json:"memstats"`
Cmdline []string `json:"cmdline"`
2015-04-21 12:51:01 +03:00
2015-05-01 00:47:11 +03:00
Extra map[string]interface{} `json:"-"`
2015-04-21 12:51:01 +03:00
Err error `json:"-,omitempty"`
}
func NewExpvarsSource(ports []string) *ExpvarsSource {
return &ExpvarsSource{
Ports: ports,
}
}