query_counter 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: d69555984b1eaadf69789d406d1c2866abe2cb0c
4
- data.tar.gz: 7131e5990e060322feafa5ec7823a720f2ffd510
3
+ metadata.gz: fb6de4766dc8b0751b1e8cd450a4138517a0f1f0
4
+ data.tar.gz: c59e4b872729e6d65b996c99591eebbb09b7e5e1
5
5
  SHA512:
6
- metadata.gz: ea44f6c728227a52c44b30fc0c10755a0e7ec99fc1d214506559f5539ba65af12f48c9a69d76f925e18b44e88dcda0fd321b277107dbba861e6af45f8df1f06a
7
- data.tar.gz: 90ca373df91ccedb757d0dc9e115819ebdf40e20926309e519ba61c8b68ad0f03faea5431dbd0355f1eb6aa1021d32bc85eff267efebe38ba717f64da91f5bdf
6
+ metadata.gz: 5391b34427c25b7cc4f2c099fa2bf26f40c930a0dfb3860ffd9407b1bb6d09c412145d6ed78fbe948594d8ab9aae4e6694cb3154b804c698fdf2ae19540a8ec7
7
+ data.tar.gz: 8c01c0ddf20dda86042b412c06deb6d8da5f3a072f53d2a2304f7a691718b04463c1fdd583f929a0296b2d1b37f9072421321446523935906b6af61e354c57cf
@@ -5,9 +5,7 @@ module QueryCounter
5
5
  end
6
6
 
7
7
  def call(env)
8
- Thread.current[:starting_gc_count] = GC.count
9
- Thread.current[:starting_count_objects] = ObjectSpace.count_objects
10
- QueryCounter.reset
8
+ QueryCounter.collect
11
9
  @app.call(env)
12
10
  end
13
11
  end
data/lib/query_counter.rb CHANGED
@@ -31,6 +31,12 @@ module QueryCounter
31
31
  current_collector.reset
32
32
  end
33
33
 
34
+ def self.collect
35
+ Thread.current[:starting_gc_count] = GC.count
36
+ Thread.current[:starting_count_objects] = ObjectSpace.count_objects
37
+ reset
38
+ end
39
+
34
40
  def self.around
35
41
  new_collector = ::QueryCounter::Collector.new
36
42
  old_collector, Thread.current[:temporary_query_counter_collector] = Thread.current[:temporary_query_counter_collector], new_collector
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_counter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-02 00:00:00.000000000 Z
11
+ date: 2019-01-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Used for monitoring number of external calls
14
14
  email: dougyouch@gmail.com
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.5.1
44
+ rubygems_version: 2.5.2.3
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: Count requests to external systems