graphql-metrics 5.0.7 → 5.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb76c2152e1b9b2f4aa99e247bbe12d4c73dc025782f0aab882b13b52c2fc842
4
- data.tar.gz: 704828351a5ecd8d46543137fae938e9305a3e3387cfd09f18658ccc14805ea4
3
+ metadata.gz: f54fe0807d964c7ddf402984339caf1c29ba21953db7090ecbf948051048e5ee
4
+ data.tar.gz: 694a4221b1673386f3104cd8bc0c5e5518f95505cdbbf7330cb98ee7e555bf1a
5
5
  SHA512:
6
- metadata.gz: 3a8482de9c2476cdda17d2368a9a814c3be8344bf53e6599dff40302db2e0d8386d7f2e7882862253b0bd58a1cdeda1429d541953e69c85ba897019b0f18fbf7
7
- data.tar.gz: d42a59103325ed909e1d4954269c4fd9d99c70207302adfc6e490005657fff87dd1318dc3d37deb0da60d0561a4c588b08aeaba26204fb8ed0bb71678b0548a5
6
+ metadata.gz: f35acb43fde5fdb41b00e2f5fa4e99c2d478bf062630320e521134c8190a0820d81bf0aad9edc3882690a08c5b323998fbc41d1c98542d130e726a1982211fd9
7
+ data.tar.gz: 7c7d3874d910f1587e65f95c163a12d236e86b5b92b58cbaaa51061e7b0420092357c2f2af87c393fba65174e8ef76ab928a7da5fdc22d984c17740484032087
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 5.0.8
2
+ -----
3
+ - [76](https://github.com/Shopify/graphql-metrics/pull/76) Reduce object allocations
4
+
1
5
  5.0.7
2
6
  -----
3
7
  - [75](https://github.com/Shopify/graphql-metrics/pull/75) Trace: capture path before yielding
@@ -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
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
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)/})
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module Metrics
5
- VERSION = "5.0.7"
5
+ VERSION = "5.0.8"
6
6
  end
7
7
  end
@@ -51,8 +51,12 @@ module GraphQL
51
51
  Process.clock_gettime(Process::CLOCK_MONOTONIC)
52
52
  end
53
53
 
54
- def self.time(*args)
55
- TimedResult.new(*args) { yield }
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(offset_time = nil)
79
- @offset_time = offset_time
80
- @start_time = GraphQL::Metrics.current_time_monotonic
81
- @result = yield
82
- @duration = GraphQL::Metrics.current_time_monotonic - @start_time
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.7
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-04-19 00:00:00.000000000 Z
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
- post_install_message:
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.3.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: []