-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5190 from zvkemp/fix-requires
require parent Tracing module before defining children
- Loading branch information
Showing
26 changed files
with
165 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
require "graphql/tracing/platform_trace" | ||
|
||
module GraphQL | ||
module Tracing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
require "graphql/tracing/platform_tracing" | ||
|
||
module GraphQL | ||
module Tracing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# frozen_string_literal: true | ||
|
||
module GraphQL | ||
module Tracing | ||
# This trace class calls legacy-style tracer with payload hashes. | ||
# New-style `trace_with` modules significantly reduce the overhead of tracing, | ||
# but that advantage is lost when legacy-style tracers are also used (since the payload hashes are still constructed). | ||
module CallLegacyTracers | ||
def lex(query_string:) | ||
(@multiplex || @query).trace("lex", { query_string: query_string }) { super } | ||
end | ||
|
||
def parse(query_string:) | ||
(@multiplex || @query).trace("parse", { query_string: query_string }) { super } | ||
end | ||
|
||
def validate(query:, validate:) | ||
query.trace("validate", { validate: validate, query: query }) { super } | ||
end | ||
|
||
def analyze_multiplex(multiplex:) | ||
multiplex.trace("analyze_multiplex", { multiplex: multiplex }) { super } | ||
end | ||
|
||
def analyze_query(query:) | ||
query.trace("analyze_query", { query: query }) { super } | ||
end | ||
|
||
def execute_multiplex(multiplex:) | ||
multiplex.trace("execute_multiplex", { multiplex: multiplex }) { super } | ||
end | ||
|
||
def execute_query(query:) | ||
query.trace("execute_query", { query: query }) { super } | ||
end | ||
|
||
def execute_query_lazy(query:, multiplex:) | ||
multiplex.trace("execute_query_lazy", { multiplex: multiplex, query: query }) { super } | ||
end | ||
|
||
def execute_field(field:, query:, ast_node:, arguments:, object:) | ||
query.trace("execute_field", { field: field, query: query, ast_node: ast_node, arguments: arguments, object: object, owner: field.owner, path: query.context[:current_path] }) { super } | ||
end | ||
|
||
def execute_field_lazy(field:, query:, ast_node:, arguments:, object:) | ||
query.trace("execute_field_lazy", { field: field, query: query, ast_node: ast_node, arguments: arguments, object: object, owner: field.owner, path: query.context[:current_path] }) { super } | ||
end | ||
|
||
def authorized(query:, type:, object:) | ||
query.trace("authorized", { context: query.context, type: type, object: object, path: query.context[:current_path] }) { super } | ||
end | ||
|
||
def authorized_lazy(query:, type:, object:) | ||
query.trace("authorized_lazy", { context: query.context, type: type, object: object, path: query.context[:current_path] }) { super } | ||
end | ||
|
||
def resolve_type(query:, type:, object:) | ||
query.trace("resolve_type", { context: query.context, type: type, object: object, path: query.context[:current_path] }) { super } | ||
end | ||
|
||
def resolve_type_lazy(query:, type:, object:) | ||
query.trace("resolve_type_lazy", { context: query.context, type: type, object: object, path: query.context[:current_path] }) { super } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module GraphQL | ||
module Tracing | ||
module LegacyHooksTrace | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
require "graphql/tracing/trace" | ||
|
||
module GraphQL | ||
module Tracing | ||
NullTrace = Trace.new | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
require "graphql/tracing" | ||
|
||
module GraphQL | ||
module Tracing | ||
module PrometheusTrace | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.