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

Debug steps to narrow the source of newrelic+graphql-core performance regression #830

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8eea9e0
Short-circuit wrap_execute_operation
Jun 12, 2023
00f8fa1
Bypass graphql wrap_resolve_field
Jun 12, 2023
a2684e1
Bypass graphql wrap_resolver
Jun 12, 2023
8b46f40
Bypass instrument_graphql_execute
Jun 12, 2023
63a245a
Bypass only wrap_resolve_field
Jun 12, 2023
a063c94
Bypass wrap_execute_operation
Jun 12, 2023
a2851ff
Bypass wrap_execute_operation
Jun 12, 2023
5b85745
Disable by other means
Jun 12, 2023
f31c536
Reintroduce graphene hooks
Jun 12, 2023
44f39d0
Kill graphene, add graphql hook #1
Jun 12, 2023
dcf409b
Kill graphql hook #1, add graphql hook #2
Jun 12, 2023
b21bc15
Kill graphql hook #2, add graphql hook #3
Jun 12, 2023
d79ddb1
Kill graphql hook #3, add graphql hook #4
Jun 12, 2023
4eb82dc
Kill graphql hook #4, add graphql hook #5
Jun 12, 2023
c31be5d
Kill graphql hook #5, add graphql hook #6-#12
Jun 12, 2023
e179d0b
Reactivate regression
Jun 12, 2023
942d1c9
Bypass all instrument_graphql_execute except wrap_get_field_def
Jun 12, 2023
750e023
Disable wrap_get_field_def, enable wrap_resolve_field
Jun 12, 2023
4745f18
Disable wrap_resolve_field, enable wrap_execute_operation
Jun 12, 2023
e52981f
Disable wrap_execute_operation, enable all ExecutionContext wrappers
Jun 12, 2023
2edd858
ExecutionContext wrappers DID contribute to regression. Which one?
Jun 12, 2023
03a7bca
Disable wrap_get_field_def, enable wrap_resolve_field
Jun 12, 2023
99bd706
Disable wrap_resolve_field, enable wrap_execute_operation
Jun 12, 2023
a762ab4
Disable wrap_execute_operation, re-enable wrap_resolve_field and
Jun 12, 2023
ee396f4
Add a hi
Jun 12, 2023
e037372
Double check attr set
Jun 12, 2023
bced910
Short-circuit wrap_resolver
Jun 12, 2023
458c3ab
Shortcircuit before traces
Jun 12, 2023
f2252ac
Short circuit after transaction check
Jun 12, 2023
3797549
Immediate short-circuit
Jun 12, 2023
f8557b6
Immediate short-circuit
Jun 12, 2023
2d26c4a
Immediate short-circuit
Jun 12, 2023
72bad0d
Remove shorts
Jun 12, 2023
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
92 changes: 46 additions & 46 deletions newrelic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2205,57 +2205,57 @@ def _process_module_builtin_defaults():
_process_module_definition("gluon.contrib.feedparser", "newrelic.hooks.external_feedparser")
_process_module_definition("gluon.contrib.memcache.memcache", "newrelic.hooks.memcache_memcache")

_process_module_definition(
"graphene.types.schema",
"newrelic.hooks.framework_graphene",
"instrument_graphene_types_schema",
)

_process_module_definition(
"graphql.graphql",
"newrelic.hooks.framework_graphql",
"instrument_graphql",
)
# _process_module_definition(
# "graphene.types.schema",
# "newrelic.hooks.framework_graphene",
# "instrument_graphene_types_schema",
# )

# _process_module_definition(
# "graphql.graphql",
# "newrelic.hooks.framework_graphql",
# "instrument_graphql",
# )
_process_module_definition(
"graphql.execution.execute",
"newrelic.hooks.framework_graphql",
"instrument_graphql_execute",
)
_process_module_definition(
"graphql.execution.executor",
"newrelic.hooks.framework_graphql",
"instrument_graphql_execute",
)
_process_module_definition(
"graphql.execution.middleware",
"newrelic.hooks.framework_graphql",
"instrument_graphql_execution_middleware",
)
_process_module_definition(
"graphql.execution.utils",
"newrelic.hooks.framework_graphql",
"instrument_graphql_execution_utils",
)
_process_module_definition(
"graphql.error.located_error",
"newrelic.hooks.framework_graphql",
"instrument_graphql_error_located_error",
)
_process_module_definition(
"graphql.language.parser",
"newrelic.hooks.framework_graphql",
"instrument_graphql_parser",
)
_process_module_definition(
"graphql.validation.validate",
"newrelic.hooks.framework_graphql",
"instrument_graphql_validate",
)
_process_module_definition(
"graphql.validation.validation",
"newrelic.hooks.framework_graphql",
"instrument_graphql_validate",
)
# _process_module_definition(
# "graphql.execution.executor",
# "newrelic.hooks.framework_graphql",
# "instrument_graphql_execute",
# )
# _process_module_definition(
# "graphql.execution.middleware",
# "newrelic.hooks.framework_graphql",
# "instrument_graphql_execution_middleware",
# )
# _process_module_definition(
# "graphql.execution.utils",
# "newrelic.hooks.framework_graphql",
# "instrument_graphql_execution_utils",
# )
# _process_module_definition(
# "graphql.error.located_error",
# "newrelic.hooks.framework_graphql",
# "instrument_graphql_error_located_error",
# )
# _process_module_definition(
# "graphql.language.parser",
# "newrelic.hooks.framework_graphql",
# "instrument_graphql_parser",
# )
# _process_module_definition(
# "graphql.validation.validate",
# "newrelic.hooks.framework_graphql",
# "instrument_graphql_validate",
# )
# _process_module_definition(
# "graphql.validation.validation",
# "newrelic.hooks.framework_graphql",
# "instrument_graphql_validate",
# )

_process_module_definition(
"ariadne.asgi",
Expand Down
14 changes: 7 additions & 7 deletions newrelic/hooks/framework_graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,21 +462,21 @@ def instrument_graphql_execute(module):
if hasattr(module, "get_field_def"):
wrap_function_wrapper(module, "get_field_def", wrap_get_field_def)
if hasattr(module, "ExecutionContext"):
wrap_function_wrapper(module, "ExecutionContext.__init__", wrap_executor_context_init)
# wrap_function_wrapper(module, "ExecutionContext.__init__", wrap_executor_context_init)

if hasattr(module.ExecutionContext, "resolve_field"):
wrap_function_wrapper(module, "ExecutionContext.resolve_field", wrap_resolve_field)
elif hasattr(module.ExecutionContext, "execute_field"):
wrap_function_wrapper(module, "ExecutionContext.execute_field", wrap_resolve_field)

if hasattr(module.ExecutionContext, "execute_operation"):
wrap_function_wrapper(module, "ExecutionContext.execute_operation", wrap_execute_operation)
# if hasattr(module.ExecutionContext, "execute_operation"):
# wrap_function_wrapper(module, "ExecutionContext.execute_operation", wrap_execute_operation)

if hasattr(module, "resolve_field"):
wrap_function_wrapper(module, "resolve_field", wrap_resolve_field)
# if hasattr(module, "resolve_field"):
# wrap_function_wrapper(module, "resolve_field", wrap_resolve_field)

if hasattr(module, "execute_operation"):
wrap_function_wrapper(module, "execute_operation", wrap_execute_operation)
# if hasattr(module, "execute_operation"):
# wrap_function_wrapper(module, "execute_operation", wrap_execute_operation)


def instrument_graphql_execution_utils(module):
Expand Down