open-nomad/command/agent/metrics_endpoint.go
2017-09-13 19:21:21 +00:00

14 lines
323 B
Go

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