graphql-metrics 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37973ad72745f698107a0877761b9b6fd8f065da661f044eec8b59cfe8c8be0b
4
- data.tar.gz: 06d1bc48ac6640e982ef7c258306e99b0fde8808c8f57eddf1e0ef95baceabfa
3
+ metadata.gz: c0f132a7bc5eabcd7d3d909b3342f5f3855df4526ca06ed17eb5c2096fb5c0a5
4
+ data.tar.gz: a36decb5cb868fc081a6053420b24d2934e71194f850e4589343160aa3ff8b59
5
5
  SHA512:
6
- metadata.gz: 25a8e51676bd6d62e9c6dd039a0b23388c7f60fbcb994ccaa171d7e1956dfb0cb0fb8d4fbb826468357bcd4cbc96a118659cde38f81f4c6303870c4b2dc7516c
7
- data.tar.gz: a2a47c0f7a88c5f9e01e5be0bf464e3c6ff4b3a4ebf88d3c221c18e9ee6d1f65d8cf4dfe9492599d4cd386b0fa3efe33ba2887d94d2512fdcdcd6160b1743aea
6
+ metadata.gz: 3570b95636f5200b7d487e71354717ed0a69e0e04e30a6f2f0131f8739158f018a244b8e8a1ff76c5574f00038ff8a738b279f6925d518d97500f35fc2730a90
7
+ data.tar.gz: f666ab46f5195b6b3344b2c7bd657a441feae3878595f62a7a233705781723352371854c66e6a1ceb66ff120d5cb0b001e7c447761377babf930de887d0cf906
@@ -1,7 +1,12 @@
1
+ 4.0.4
2
+ -----
3
+ - [33](https://github.com/Shopify/graphql-metrics/pull/33) Setup tracing using lex or execute_multiplex tracer events.
4
+
1
5
  4.0.3
2
6
  -----
3
7
  - [32](https://github.com/Shopify/graphql-metrics/pull/32) Split validate and analyze_query tracer events (encompasses #30).
4
8
  - [30](https://github.com/Shopify/graphql-metrics/pull/30) Handle queries that have already been parsed (thank you @jturkel).
9
+ - [29](https://github.com/Shopify/graphql-metrics/pull/29) Remove runtime dependency on activesupport (thank you @jturkel).
5
10
 
6
11
  4.0.2
7
12
  -----
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql-metrics (4.0.3)
4
+ graphql-metrics (4.0.4)
5
5
  concurrent-ruby (~> 1.1.0)
6
6
  graphql (>= 1.10.8)
7
7
 
@@ -4,6 +4,7 @@ module GraphQL
4
4
  module Metrics
5
5
  class Tracer
6
6
  # NOTE: These constants come from the graphql ruby gem.
7
+ GRAPHQL_GEM_LEX_KEY = 'lex'
7
8
  GRAPHQL_GEM_EXECUTE_MULTIPLEX_KEY = 'execute_multiplex'
8
9
  GRAPHQL_GEM_PARSING_KEY = 'parse'
9
10
  GRAPHQL_GEM_VALIDATION_KEY = 'validate'
@@ -23,6 +24,8 @@ module GraphQL
23
24
  # NOTE: Not all tracing events are handled here, but those that are are handled in this case statement in
24
25
  # chronological order.
25
26
  case key
27
+ when GRAPHQL_GEM_LEX_KEY
28
+ return setup_tracing(&block)
26
29
  when GRAPHQL_GEM_EXECUTE_MULTIPLEX_KEY
27
30
  return setup_tracing(&block)
28
31
  when GRAPHQL_GEM_PARSING_KEY
@@ -73,6 +76,8 @@ module GraphQL
73
76
  end
74
77
 
75
78
  def setup_tracing
79
+ return yield if pre_context.query_start_time
80
+
76
81
  pre_context.query_start_time = GraphQL::Metrics.current_time
77
82
  pre_context.query_start_time_monotonic = GraphQL::Metrics.current_time_monotonic
78
83
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module Metrics
5
- VERSION = "4.0.3"
5
+ VERSION = "4.0.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Butcher