Sha256: ca789b6b45e90875a10ad80f28e1ddecbeabd4db0d47bf94d4434ad9c8581238
Contents?: true
Size: 991 Bytes
Versions: 35
Compression:
Stored size: 991 Bytes
Contents
# frozen_string_literal: true module GraphQL module Tracing # This implementation forwards events to ActiveSupport::Notifications # with a `graphql.` prefix. # module ActiveSupportNotificationsTracing # A cache of frequently-used keys to avoid needless string allocations KEYS = { "lex" => "graphql.lex", "parse" => "graphql.parse", "validate" => "graphql.validate", "analyze_multiplex" => "graphql.analyze_multiplex", "analyze_query" => "graphql.analyze_query", "execute_query" => "graphql.execute_query", "execute_query_lazy" => "graphql.execute_query_lazy", "execute_field" => "graphql.execute_field", "execute_field_lazy" => "graphql.execute_field_lazy", } def self.trace(key, metadata) prefixed_key = KEYS[key] || "graphql.#{key}" ActiveSupport::Notifications.instrument(prefixed_key, metadata) do yield end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems