12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/graphql/metrics/instrumentation.rb', line 12
def execute_multiplex(multiplex:)
return super if multiplex.context[GraphQL::Metrics::SKIP_GRAPHQL_METRICS_ANALYSIS]
result = nil
multiplex.queries.each do |query|
ns = query.context.namespace(CONTEXT_NAMESPACE)
ns[GraphQL::Metrics::TIMINGS_CAPTURE_ENABLED] = @capture_field_timings
ns[GraphQL::Metrics::INLINE_FIELD_TIMINGS] = Hash.new { |h, k| h[k] = [] }
ns[GraphQL::Metrics::LAZY_FIELD_TIMINGS] = Hash.new { |h, k| h[k] = [] }
end
begin
result = super
ensure
multiplex.queries.each do |query|
handle_query(query) if query.valid?
end
end
result
end
|