MM-53023: Add origin client to ObserveAPIEndpointDuration (#23631)

* Add origin device to ObserveAPIEndpointDuration

* Fix generation of einterfaces mocks

* make einterfaces-mocks

* Use request's query and headers to get origin

* Add desktop to the origin device identification

* Test originDevice function

* Rename origin device to origin client
Этот коммит содержится в:
Alejandro García Montoro
2023-10-12 19:09:52 +02:00
коммит произвёл GitHub
родитель 1fe2295c70
Коммит 2bc99398f9
4 изменённых файлов: 116 добавлений и 5 удалений

Просмотреть файл

@@ -58,7 +58,7 @@ type MetricsInterface interface {
IncrementFilesSearchCounter()
ObserveFilesSearchDuration(elapsed float64)
ObserveStoreMethodDuration(method, success string, elapsed float64)
ObserveAPIEndpointDuration(endpoint, method, statusCode string, elapsed float64)
ObserveAPIEndpointDuration(endpoint, method, statusCode, originClient string, elapsed float64)
IncrementPostIndexCounter()
IncrementFileIndexCounter()
IncrementUserIndexCounter()

Просмотреть файл

@@ -239,9 +239,9 @@ func (_m *MetricsInterface) IncrementWebsocketReconnectEvent(eventType string) {
_m.Called(eventType)
}
// 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)
// ObserveAPIEndpointDuration provides a mock function with given fields: endpoint, method, statusCode, originClient, elapsed
func (_m *MetricsInterface) ObserveAPIEndpointDuration(endpoint string, method string, statusCode string, originClient string, elapsed float64) {
_m.Called(endpoint, method, statusCode, originClient, elapsed)
}
// ObserveClusterRequestDuration provides a mock function with given fields: elapsed