open-nomad/command/agent/metrics_endpoint.go

14 lines
323 B
Go
Raw Normal View History

package agent
import (
"net/http"
)
2017-09-08 18:50:07 +00:00
// MetricsRequest returns metrics in JSON format
func (s *HTTPServer) MetricsRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
if req.Method == "GET" {
2017-09-08 18:50:07 +00:00
return s.agent.InmemSink.DisplayMetrics(resp, req)
}
return nil, CodedError(405, ErrInvalidMethod)
}