Class: GraphQL::Tracing::StatsdTracing

Inherits:
PlatformTracing show all
Defined in:
lib/graphql/tracing/statsd_tracing.rb

Instance Method Summary collapse

Methods inherited from PlatformTracing

inherited, #trace, use

Constructor Details

#initialize(statsd:, **rest) ⇒ StatsdTracing

Parameters

  • statsd (Object) — A statsd client

:call-seq:

initialize(Object statsd:, **rest)


27
28
29
30
# File 'lib/graphql/tracing/statsd_tracing.rb', line 27

def initialize(statsd:, **rest)
  @statsd = statsd
  super(**rest)
end

Instance Method Details

#platform_authorized_key(type) ⇒ Object



42
43
44
# File 'lib/graphql/tracing/statsd_tracing.rb', line 42

def platform_authorized_key(type)
  "graphql.authorized.#{type.graphql_name}"
end

#platform_field_key(type, field) ⇒ Object



38
39
40
# File 'lib/graphql/tracing/statsd_tracing.rb', line 38

def platform_field_key(type, field)
  "graphql.#{type.graphql_name}.#{field.graphql_name}"
end

#platform_resolve_type_key(type) ⇒ Object



46
47
48
# File 'lib/graphql/tracing/statsd_tracing.rb', line 46

def platform_resolve_type_key(type)
  "graphql.resolve_type.#{type.graphql_name}"
end

#platform_trace(platform_key, key, data) ⇒ Object



32
33
34
35
36
# File 'lib/graphql/tracing/statsd_tracing.rb', line 32

def platform_trace(platform_key, key, data)
  @statsd.time(platform_key) do
    yield
  end
end