open-nomad/command/agent/stats_endpoint.go

13 lines
297 B
Go
Raw Normal View History

package agent
import "net/http"
2016-05-24 23:41:35 +00:00
func (s *HTTPServer) ClientStatsRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
if s.agent.client == nil {
return nil, clientNotRunning
}
clientStats := s.agent.client.StatsReporter()
return clientStats.LatestHostStats(), nil
}