class GraphQL::Tracing::StatsdTracing

Public Class Methods

new(statsd:, **rest) click to toggle source

@param statsd [Object] A statsd client

Calls superclass method GraphQL::Tracing::PlatformTracing::new
# File lib/graphql/tracing/statsd_tracing.rb, line 18
def initialize(statsd:, **rest)
  @statsd = statsd
  super(**rest)
end

Public Instance Methods

platform_authorized_key(type) click to toggle source
# File lib/graphql/tracing/statsd_tracing.rb, line 33
def platform_authorized_key(type)
  "graphql.authorized.#{type.graphql_name}"
end
platform_field_key(type, field) click to toggle source
# File lib/graphql/tracing/statsd_tracing.rb, line 29
def platform_field_key(type, field)
  "graphql.#{type.graphql_name}.#{field.graphql_name}"
end
platform_resolve_type_key(type) click to toggle source
# File lib/graphql/tracing/statsd_tracing.rb, line 37
def platform_resolve_type_key(type)
  "graphql.resolve_type.#{type.graphql_name}"
end
platform_trace(platform_key, key, data) { || ... } click to toggle source
# File lib/graphql/tracing/statsd_tracing.rb, line 23
def platform_trace(platform_key, key, data)
  @statsd.time(platform_key) do
    yield
  end
end