Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor version number checks #1738

Merged
merged 14 commits into from
Jul 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert trace config changes
b-deam committed Jun 22, 2023

Verified

This commit was signed with the committer’s verified signature.
b-deam Brad Deam
commit 94d863418f013b6d1a5498fb476f93b8cfb31707
24 changes: 12 additions & 12 deletions esrally/client/factory.py
Original file line number Diff line number Diff line change
@@ -210,6 +210,18 @@ def loads(self, data):
else:
return super().loads(data)

async def on_request_start(session, trace_config_ctx, params):
RallyAsyncElasticsearch.on_request_start()

async def on_request_end(session, trace_config_ctx, params):
RallyAsyncElasticsearch.on_request_end()

trace_config = aiohttp.TraceConfig()
trace_config.on_request_start.append(on_request_start)
trace_config.on_request_end.append(on_request_end)
# ensure that we also stop the timer when a request "ends" with an exception (e.g. a timeout)
trace_config.on_request_exception.append(on_request_end)

# override the builtin JSON serializer
self.client_options["serializer"] = LazyJSONSerializer()

@@ -228,18 +240,6 @@ def loads(self, data):
**self.client_options,
)

async def on_request_start(session, trace_config_ctx, params):
async_client.on_request_start()

async def on_request_end(session, trace_config_ctx, params):
async_client.on_request_end()

trace_config = aiohttp.TraceConfig()
trace_config.on_request_start.append(on_request_start)
trace_config.on_request_end.append(on_request_end)
# ensure that we also stop the timer when a request "ends" with an exception (e.g. a timeout)
trace_config.on_request_exception.append(on_request_end)

# the AsyncElasticsearch constructor automatically creates the corresponding NodeConfig objects, so we set
# their instance attributes after they've been instantiated
for node_connection in async_client.transport.node_pool.all():