github.com/hooklift/nomad@v0.5.7-0.20170407200202-db11e7dd7b55/command/agent/stats_endpoint.go (about)

     1  package agent
     2  
     3  import "net/http"
     4  
     5  func (s *HTTPServer) ClientStatsRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
     6  	if s.agent.client == nil {
     7  		return nil, clientNotRunning
     8  	}
     9  
    10  	clientStats := s.agent.client.StatsReporter()
    11  	return clientStats.LatestHostStats(), nil
    12  }