github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/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  }