alacrity-rails 0.9.0 → 0.9.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: c20b077e539977d327f8e4f3706ab279ee97ce9f
4
- data.tar.gz: 5847604c15ed207d8e53935381526202af9d6f1c
3
+ metadata.gz: d34463ea5561472561eeff41e257a21fbac9d6f5
4
+ data.tar.gz: 83290c1e8b6258f4d70bcb35ad91531ac73ca7f5
5
5
  SHA512:
6
- metadata.gz: 98ff75edc7d3c32dc2294cd9da6e5dae0b193a08a7c196811a0bac06c7fd08667614c84296c601b96899a17b68a715821682a9e1c595b4c6e6fa28715fd49e7c
7
- data.tar.gz: 96826fa45f10a3de58b0dc97ca1842a2204a71212c975c2729d02bdf00455b927575b747628e73c285264bd7ea6b83e0ddbe524d3caf121d1174428f964d5ad6
6
+ metadata.gz: d0e8039ba1aee3b5a52075c8c92170bbc48b6b607b59879c7f848e73e6a1ac7296c020760054367ed7a5c8e94a8b15efdd8a17fa237e4cc6b43aeeed525115ba
7
+ data.tar.gz: a775fe03c032002f80288a4f28076ced5a9d3f46b2e4848b3f2b7de0f1f496251d470a7d1f4613b19e1ff9f068ac0bdfaf034510f683ca7a5da27e5f0ca59419
@@ -2,24 +2,20 @@ module AlacrityRails
2
2
  module Probe
3
3
  class Excon
4
4
  def self.activate
5
- ::Excon.defaults[:instrumentor] = self if defined?(::Excon)
6
- end
7
-
8
- def self.instrument(name, data, &block)
9
- return unless name == 'excon.request'
10
-
11
- started = DateTime.now
12
-
13
- block&
5
+ if defined?(::Excon)
6
+ ::Excon.defaults[:instrumentor] = ActiveSupport::Notifications
14
7
 
15
- AlacrityRails::Client.store_timeline_event(
16
- name: 'Excon Request',
17
- event_type: 'http',
18
- engine: 'Excon',
19
- started_at: started,
20
- finished_at: DateTime.now,
21
- detail: "#{data[:scheme]}://#{data[:host]}#{data[:path]}"
22
- )
8
+ ActiveSupport::Notifications.subscribe 'excon.request' do |name, started, finished, unique_id, data|
9
+ AlacrityRails::Client.store_timeline_event(
10
+ name: 'Excon Request',
11
+ event_type: 'http',
12
+ engine: 'Excon',
13
+ started_at: started,
14
+ finished_at: finished,
15
+ detail: "#{data[:scheme]}://#{data[:host]}#{data[:path]}"
16
+ )
17
+ end
18
+ end
23
19
  end
24
20
  end
25
21
  end
@@ -13,7 +13,8 @@ module AlacrityRails
13
13
  Probe::ActiveJob,
14
14
  Probe::ActiveModelSerializers,
15
15
  Probe::ActiveRecord,
16
- Probe::MongoDriver
16
+ Probe::MongoDriver,
17
+ Probe::Excon
17
18
  ].each(&:activate)
18
19
  end
19
20
  end
@@ -1,3 +1,3 @@
1
1
  module AlacrityRails
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alacrity-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alacrity, LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-23 00:00:00.000000000 Z
11
+ date: 2017-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails