Sha256: fc7ab70dea9e4dcf49141a4b23d2271ce8858f71a930801551825c1efa039da2

Contents?: true

Size: 1.12 KB

Versions: 146

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

module GraphQL
  module Tracing
    class StatsdTracing < PlatformTracing
      self.platform_keys = {
        'lex' => "graphql.lex",
        'parse' => "graphql.parse",
        'validate' => "graphql.validate",
        'analyze_query' => "graphql.analyze_query",
        'analyze_multiplex' => "graphql.analyze_multiplex",
        'execute_multiplex' => "graphql.execute_multiplex",
        'execute_query' => "graphql.execute_query",
        'execute_query_lazy' => "graphql.execute_query_lazy",
      }

      # @param statsd [Object] A statsd client
      def initialize(statsd:, **rest)
        @statsd = statsd
        super(**rest)
      end

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

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

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

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

Version data entries

146 entries across 146 versions & 2 rubygems

Version Path
graphql-2.4.4 lib/graphql/tracing/statsd_tracing.rb
graphql-2.4.3 lib/graphql/tracing/statsd_tracing.rb
graphql-2.4.2 lib/graphql/tracing/statsd_tracing.rb
graphql-2.4.1 lib/graphql/tracing/statsd_tracing.rb
graphql-2.4.0 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.20 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.19 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.18 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.17 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.16 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.15 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.14 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.13 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.12 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.11 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.10 lib/graphql/tracing/statsd_tracing.rb
graphql-2.2.16 lib/graphql/tracing/statsd_tracing.rb
graphql-2.1.13 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.9 lib/graphql/tracing/statsd_tracing.rb
graphql-2.3.8 lib/graphql/tracing/statsd_tracing.rb