Skip to content

Commit

Permalink
Moving FailedRequestsCollector call into BasicHTTPFrontendConnector (#…
Browse files Browse the repository at this point in the history
…1120)

This PR deletes orphaned (not used) router and move this functionality
to `BasicHTTPFrontendConnector` where it should be.
  • Loading branch information
pdelewski authored Dec 18, 2024
1 parent 224d57d commit 6cd4bc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 3 additions & 0 deletions quesma/frontend_connectors/basic_http_frontend_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func (h *BasicHTTPFrontendConnector) GetChildComponents() []interface{} {
func (h *BasicHTTPFrontendConnector) SetDependencies(deps quesma_api.Dependencies) {
h.phoneHomeClient = deps.PhoneHomeAgent()
h.debugInfoCollector = deps.DebugInfoCollector()
deps.PhoneHomeAgent().FailedRequestsCollector(func() int64 {
return h.routerInstance.FailedRequests.Load()
})
}

func NewBasicHTTPFrontendConnector(endpoint string, config *config.QuesmaConfiguration) *BasicHTTPFrontendConnector {
Expand Down
8 changes: 0 additions & 8 deletions quesma/quesma/dual_write_proxy_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"quesma/ab_testing"
"quesma/clickhouse"
"quesma/elasticsearch"
"quesma/frontend_connectors"
"quesma/ingest"
"quesma/logger"
"quesma/queryparser"
Expand Down Expand Up @@ -80,13 +79,6 @@ func newDualWriteProxyV2(dependencies quesma_api.Dependencies, schemaLoader clic
// tests should not be run with optimization enabled by default
queryProcessor.EnableQueryOptimization(config)

routerInstance := frontend_connectors.NewRouterV2(config)

dependencies.PhoneHomeAgent().FailedRequestsCollector(func() int64 {

return routerInstance.FailedRequests.Load()
})

ingestRouter := ConfigureIngestRouterV2(config, dependencies, ingestProcessor, resolver)
searchRouter := ConfigureSearchRouterV2(config, dependencies, registry, logManager, queryProcessor, resolver)

Expand Down

0 comments on commit 6cd4bc1

Please sign in to comment.