MM-23131 Include HTTP status code in the metrics (#14240)
* ResponseWriter wrapper to get status code For our metrics, we need the status code returned by a request so this wrapper includes a new method StatusCode() that includes the desired code * Shadow the responsewriter variable in the handlers In order to avoid confusion to people deciding what variable to use. I've also changed the tests to reflect this change and added a new one that checks the Flush method works
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
53c1c0d4b4
Коммит
aafea55976
@@ -171,9 +171,9 @@ func (_m *MetricsInterface) IncrementWebsocketEvent(eventType string) {
|
||||
_m.Called(eventType)
|
||||
}
|
||||
|
||||
// ObserveApiEndpointDuration provides a mock function with given fields: endpoint, method, elapsed
|
||||
func (_m *MetricsInterface) ObserveApiEndpointDuration(endpoint string, method string, elapsed float64) {
|
||||
_m.Called(endpoint, method, elapsed)
|
||||
// ObserveApiEndpointDuration provides a mock function with given fields: endpoint, method, statusCode, elapsed
|
||||
func (_m *MetricsInterface) ObserveApiEndpointDuration(endpoint string, method string, statusCode string, elapsed float64) {
|
||||
_m.Called(endpoint, method, statusCode, elapsed)
|
||||
}
|
||||
|
||||
// ObserveClusterRequestDuration provides a mock function with given fields: elapsed
|
||||
|
||||
Ссылка в новой задаче
Block a user