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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/graphql/metrics/tracer.rb +5 -0
- data/lib/graphql/metrics/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0f132a7bc5eabcd7d3d909b3342f5f3855df4526ca06ed17eb5c2096fb5c0a5
|
4
|
+
data.tar.gz: a36decb5cb868fc081a6053420b24d2934e71194f850e4589343160aa3ff8b59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3570b95636f5200b7d487e71354717ed0a69e0e04e30a6f2f0131f8739158f018a244b8e8a1ff76c5574f00038ff8a738b279f6925d518d97500f35fc2730a90
|
7
|
+
data.tar.gz: f666ab46f5195b6b3344b2c7bd657a441feae3878595f62a7a233705781723352371854c66e6a1ceb66ff120d5cb0b001e7c447761377babf930de887d0cf906
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-----
|
data/Gemfile.lock
CHANGED
@@ -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
|
|