influxdb/monitor/go_runtime.go

22 lines
448 B
Go
Raw Normal View History

2015-09-01 03:17:13 +00:00
package monitor
import (
"runtime"
"github.com/influxdata/influxdb/monitor/diagnostics"
2015-09-01 03:17:13 +00:00
)
2016-12-30 20:34:53 +00:00
// goRuntime captures Go runtime diagnostics.
2015-09-01 03:17:13 +00:00
type goRuntime struct{}
func (g *goRuntime) Diagnostics() (*diagnostics.Diagnostics, error) {
d := map[string]interface{}{
"GOARCH": runtime.GOARCH,
"GOOS": runtime.GOOS,
"GOMAXPROCS": runtime.GOMAXPROCS(-1),
"version": runtime.Version(),
}
return diagnostics.RowFromMap(d), nil
2015-09-01 03:17:13 +00:00
}