alacrity-rails 0.6.0 → 0.7.0

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: 945c04e5315e8904f9b0657b19e669eb40e68635
4
- data.tar.gz: 11628efb7dc6bf0897d3b81b1a055013683c4b7b
3
+ metadata.gz: ab74e34ae13762f9265d708272da2147e27221e1
4
+ data.tar.gz: 82c8da772eab9cca4472c97cb89189ccc6d5eda5
5
5
  SHA512:
6
- metadata.gz: fb89f6e2c1d0633a9b690b5c8dea9004385f11ae66eb426ba0fa319ccb3620a7e17e07892e0664e3baf6afc5239255e12a0b1ddba109c6603dfcd2b35d96363d
7
- data.tar.gz: a256a94910e5656a759f3aa12e58d1c01747217039bb4f225c82da464ef705ac0bb6f5875eab53763046ceada9da63cabab146ebbccb835544259a87d84c5b3b
6
+ metadata.gz: 3dcc2717f055b7a4beb01ac1d52b2a1098166889e13c7c24fdc738173f2469c0f495df3b19a45075d89e1b5b17d3bcabd9feb97403e8210b617038dc7fd67b22
7
+ data.tar.gz: 535e171a6871ad612ef8b8c5de91e014eef81bd83f85b34b4de29a21187e35b090337a338509ce8a1fbfecd46597ce9fb4905fd323d8097594c3b389269be040
@@ -19,16 +19,14 @@ module AlacrityRails
19
19
  if transaction
20
20
  transaction.status = response.first
21
21
  transaction.finalize!
22
- transmission_queue.push(transaction)
22
+ transmit(transaction)
23
23
  end
24
24
  ensure
25
25
  cleanup
26
26
  end
27
27
 
28
28
  def self.log_server_startup
29
- Thread.new {
30
- transmit(AlacrityRails::Transaction::ServerStartup.new)
31
- }
29
+ transmit(AlacrityRails::Transaction::ServerStartup.new)
32
30
  end
33
31
 
34
32
  def self.transaction
@@ -40,25 +38,9 @@ module AlacrityRails
40
38
  end
41
39
 
42
40
  def self.transmit(transactable)
43
- Net::HTTP.start(*transactable.net_http_start_arguments) do |http|
44
- http.request(transactable.post_request)
45
- end
46
- end
47
-
48
- def self.transmission_queue
49
- @transmission_queue ||= []
50
- end
51
-
52
- def self.start_transmission_worker
53
41
  Thread.new do
54
- loop do
55
- sleep AlacrityRails::Config.transmission_interval
56
-
57
- if transmission_queue.any?
58
- transmit(AlacrityRails::Transaction::BulkWebTransaction.new(
59
- transmission_queue.shift(transmission_queue.length)
60
- ))
61
- end
42
+ Net::HTTP.start(*transactable.net_http_start_arguments) do |http|
43
+ http.request(transactable.post_request)
62
44
  end
63
45
  end
64
46
  end
@@ -70,7 +70,7 @@ module AlacrityRails
70
70
  The AlacrityRails::Middleware is not first in your middleware stack.
71
71
  Anything appearing above it will not be included in metrics tracking.
72
72
 
73
- #{Rails.application.config.middleware.map(&:to_s).to_yaml}
73
+ #{Rails.application.config.middleware.map(&:inspect).to_yaml}
74
74
  >
75
75
  ]
76
76
  end
@@ -3,7 +3,6 @@ module AlacrityRails
3
3
  initializer 'alacrity' do |config|
4
4
  if Config.enabled?
5
5
  Client.log_server_startup
6
- Client.start_transmission_worker
7
6
 
8
7
  config.middleware.insert_before 0, AlacrityRails::Middleware
9
8
 
@@ -1,3 +1,3 @@
1
1
  module AlacrityRails
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
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.6.0
4
+ version: 0.7.0
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-05-17 00:00:00.000000000 Z
11
+ date: 2017-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -47,7 +47,6 @@ files:
47
47
  - lib/alacrity-rails/railtie.rb
48
48
  - lib/alacrity-rails/server_config.rb
49
49
  - lib/alacrity-rails/transaction/base.rb
50
- - lib/alacrity-rails/transaction/bulk_web_transaction.rb
51
50
  - lib/alacrity-rails/transaction/connection_test.rb
52
51
  - lib/alacrity-rails/transaction/server_startup.rb
53
52
  - lib/alacrity-rails/transaction/web_transaction.rb
@@ -1,17 +0,0 @@
1
- module AlacrityRails::Transaction
2
- class BulkWebTransaction < Base
3
- attr_accessor :web_transactions
4
-
5
- def initialize(web_transactions)
6
- self.web_transactions = web_transactions
7
- end
8
-
9
- def as_json(*args)
10
- web_transactions.as_json
11
- end
12
-
13
- def self.endpoint
14
- @endpoint ||= URI("#{AlacrityRails::Config.collector_host}/v1/web-transactions")
15
- end
16
- end
17
- end