Class: Yabeda::GraphQL::Instrumentation

Inherits:
Object
  • Object
show all
Defined in:
lib/yabeda/graphql/instrumentation.rb

Instance Method Summary collapse

Instance Method Details

#after_query(query) ⇒ Object



8
9
10
11
12
13
# File 'lib/yabeda/graphql/instrumentation.rb', line 8

def after_query(query)
  cache(query).each do |_path, options|
    Yabeda.graphql.field_resolve_runtime.measure(options[:tags], options[:duration])
    Yabeda.graphql.fields_request_count.increment(options[:tags])
  end
end

#before_query(query) ⇒ Object



4
5
6
# File 'lib/yabeda/graphql/instrumentation.rb', line 4

def before_query(query)
  reset_cache!(query)
end