2017-09-04 03:50:05 +00:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2017-09-08 18:50:07 +00:00
|
|
|
// MetricsRequest returns metrics in JSON format
|
2017-09-04 03:50:05 +00:00
|
|
|
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)
|
2017-09-04 03:50:05 +00:00
|
|
|
}
|
|
|
|
return nil, CodedError(405, ErrInvalidMethod)
|
|
|
|
}
|