Module: GraphQL::Tracing
- Defined in:
- lib/graphql/tracing.rb,
lib/graphql/tracing/active_support_notifications_tracing.rb
Overview
Library entry point for performance metric reporting.
ActiveSupportNotificationsTracing is imported by default
when ActiveSupport::Notifications
is found.
You can remove it with GraphQL::Tracing.uninstall(GraphQL::Tracing::ActiveSupportNotificationsTracing)
.
Warning: Installing/uninstalling tracers is not thread-safe. Do it during application boot only.
Events:
Key | Metadata |
---|---|
lex | { query_string: String } |
parse | { query_string: String } |
validate | { query: GraphQL::Query, validate: Boolean } |
analyze_multiplex | { multiplex: GraphQL::Execution::Multiplex } |
analyze_query | { query: GraphQL::Query } |
execute_multiplex | { query: GraphQL::Execution::Multiplex } |
execute_query | { query: GraphQL::Query } |
execute_query_lazy | { query: GraphQL::Query?, queries: Array<GraphQL::Query>? } |
execute_field | { context: GraphQL::Query::Context::FieldResolutionContext } |
execute_field_lazy | { context: GraphQL::Query::Context::FieldResolutionContext } |
Defined Under Namespace
Modules: ActiveSupportNotificationsTracing
Class Method Summary collapse
-
.install(tracer) ⇒ void
Install a tracer to receive events.
-
.trace(key, metadata) ⇒ Object
Override this method to do stuff.
- .tracers ⇒ Object
- .uninstall(tracer) ⇒ Object
Class Method Details
.install(tracer) ⇒ void
This method returns an undefined value.
Install a tracer to receive events.
46 47 48 49 50 |
# File 'lib/graphql/tracing.rb', line 46 def install(tracer) if !tracers.include?(tracer) @tracers << tracer end end |
.trace(key, metadata) ⇒ Object
Override this method to do stuff
39 40 41 |
# File 'lib/graphql/tracing.rb', line 39 def trace(key, ) call_tracers(0, key, ) { yield } end |
.tracers ⇒ Object
56 57 58 |
# File 'lib/graphql/tracing.rb', line 56 def tracers @tracers ||= [] end |
.uninstall(tracer) ⇒ Object
52 53 54 |
# File 'lib/graphql/tracing.rb', line 52 def uninstall(tracer) @tracers.delete(tracer) end |