graphql-metrics 5.0.7 → 5.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/graphql_metrics.gemspec +1 -8
- data/lib/graphql/metrics/version.rb +1 -1
- data/lib/graphql/metrics.rb +11 -8
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f54fe0807d964c7ddf402984339caf1c29ba21953db7090ecbf948051048e5ee
|
4
|
+
data.tar.gz: 694a4221b1673386f3104cd8bc0c5e5518f95505cdbbf7330cb98ee7e555bf1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f35acb43fde5fdb41b00e2f5fa4e99c2d478bf062630320e521134c8190a0820d81bf0aad9edc3882690a08c5b323998fbc41d1c98542d130e726a1982211fd9
|
7
|
+
data.tar.gz: 7c7d3874d910f1587e65f95c163a12d236e86b5b92b58cbaaa51061e7b0420092357c2f2af87c393fba65174e8ef76ab928a7da5fdc22d984c17740484032087
|
data/CHANGELOG.md
CHANGED
data/graphql_metrics.gemspec
CHANGED
@@ -14,14 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = 'https://github.com/Shopify/graphql-metrics'
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
|
18
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
# if spec.respond_to?(:metadata)
|
20
|
-
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
-
# else
|
22
|
-
# raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
-
# "public gem pushes."
|
24
|
-
# end
|
17
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
25
18
|
|
26
19
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
20
|
f.match(%r{^(test|spec|features)/})
|
data/lib/graphql/metrics.rb
CHANGED
@@ -51,8 +51,12 @@ module GraphQL
|
|
51
51
|
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
52
52
|
end
|
53
53
|
|
54
|
-
def self.time(
|
55
|
-
|
54
|
+
def self.time(offset_time = nil)
|
55
|
+
start_time = current_time_monotonic
|
56
|
+
result = yield
|
57
|
+
duration = current_time_monotonic - start_time
|
58
|
+
time_since_offset = start_time - offset_time if offset_time
|
59
|
+
TimedResult.new(start_time, duration, time_since_offset, result)
|
56
60
|
end
|
57
61
|
|
58
62
|
class TimedResult
|
@@ -75,12 +79,11 @@ module GraphQL
|
|
75
79
|
#
|
76
80
|
attr_reader :result, :start_time, :duration, :time_since_offset
|
77
81
|
|
78
|
-
def initialize(
|
79
|
-
@
|
80
|
-
@
|
81
|
-
@
|
82
|
-
@
|
83
|
-
@time_since_offset = @start_time - @offset_time if @offset_time
|
82
|
+
def initialize(start_time, duration, time_since_offset, result)
|
83
|
+
@start_time = start_time
|
84
|
+
@duration = duration
|
85
|
+
@time_since_offset = time_since_offset
|
86
|
+
@result = result
|
84
87
|
end
|
85
88
|
end
|
86
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Butcher
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -229,8 +229,9 @@ files:
|
|
229
229
|
homepage: https://github.com/Shopify/graphql-metrics
|
230
230
|
licenses:
|
231
231
|
- MIT
|
232
|
-
metadata:
|
233
|
-
|
232
|
+
metadata:
|
233
|
+
allowed_push_host: https://rubygems.org
|
234
|
+
post_install_message:
|
234
235
|
rdoc_options: []
|
235
236
|
require_paths:
|
236
237
|
- lib
|
@@ -245,8 +246,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
246
|
- !ruby/object:Gem::Version
|
246
247
|
version: '0'
|
247
248
|
requirements: []
|
248
|
-
rubygems_version: 3.
|
249
|
-
signing_key:
|
249
|
+
rubygems_version: 3.4.22
|
250
|
+
signing_key:
|
250
251
|
specification_version: 4
|
251
252
|
summary: GraphQL Metrics Extractor
|
252
253
|
test_files: []
|