1
0
Fork 0

Add Go runtime info to status output

master
Philip O'Toole 9 years ago
parent 4c12cc30a8
commit 349300b743

@ -1,5 +1,6 @@
## 3.1.0 (Unreleased)
- [PR #118](https://github.com/rqlite/rqlite/pull/118): New rqlite CLI. Thanks @mkideal
- [PR #125](https://github.com/rqlite/rqlite/pull/125): Add Go runtime details to status endpoint.
## 3.0.1 (May 1st 2016)
- [PR #117](https://github.com/rqlite/rqlite/pull/117): Use Raft advertise address, if exists, during join.

@ -12,6 +12,7 @@ import (
"net"
"net/http"
"os"
"runtime"
"strings"
"time"
@ -297,6 +298,15 @@ func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request) {
return
}
rt := map[string]interface{}{
"GOARCH": runtime.GOARCH,
"GOOS": runtime.GOOS,
"GOMAXPROCS": runtime.GOMAXPROCS(0),
"numCPU": runtime.NumCPU(),
"numGoroutine": runtime.NumGoroutine(),
"version": runtime.Version(),
}
httpStatus := map[string]interface{}{
"addr": s.Addr().String(),
"auth": prettyEnabled(s.credentialStore != nil),
@ -310,9 +320,10 @@ func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request) {
// Build the status response.
status := map[string]interface{}{
"store": results,
"http": httpStatus,
"node": nodeStatus,
"runtime": rt,
"store": results,
"http": httpStatus,
"node": nodeStatus,
}
if !s.lastBackup.IsZero() {
status["last_backup"] = s.lastBackup

Loading…
Cancel
Save