appsignal 0.6.2 → 0.6.3.beta.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmJjMGRiZGFhZmQxMGU0N2MwMzkzNDQ1YmZhMjlkYzZkMDM0YmJjMA==
4
+ N2FjMjk1ZGYyZjkwNDI5NmZhNTkzMTVlMjBmZDViNjRlNTEwZTZhOA==
5
5
  data.tar.gz: !binary |-
6
- YTJhNzg1NTBmMDA4ZDlhZDU3YTgzY2YzNzMxOGVmY2RlNjI5YmY0Yw==
6
+ ZDUxODgxMTg5ZjRiMWM2NzQwYzhiOTg5ZDQ3NjBiMGI1MzI0ZTY1Yg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWNiMDkyZjI0MGNmZDE0Njg4ZDdkMGVhZWUzYWU2OTdkNzg2NmY5MzgwODAy
10
- NjMwOTNiMmQyZGI5NGI2NWIwNjllNWMzMTQ3OWRjNDRmMDgxYzRiMDcxMjI0
11
- MTY4ZTY3MjNkMWUxOGU1MTFjYjNjN2YxMTg4Zjc0OWUxMmNlMzc=
9
+ MGNkYTExNDNkMDI4ZWM4M2JkNzVkYzVkNWQyYzA4NDc1NTI5Njk1NTAxNzk2
10
+ MmExY2IzNWJhMmUwOGI0YzE0OTNmZDgzNDlmZjI3MGE5ZjMwNzIyZjJkZDlm
11
+ MmU1MDc5YTRlMGQ4MTNhOGMyNWIzODNjMmY0ODg1NDJmMTExYzA=
12
12
  data.tar.gz: !binary |-
13
- MTk2ZjVjNTIxYjlmMTIwNDVhNDEyMmZkMzE2YWY3ODE2NWM3NDFhY2VhMWVk
14
- YzA0OTgyODVhNmU2ZWZiMWI4NDE5YWI5N2RlNDlmYWExMTkzZGNmMTY1MTk1
15
- ZmNhOTAyMGJkYTJjOTcxMmU3ZTQ4YmU1MDhjNDA4Yjg4YTcwYzQ=
13
+ NzM4ZDAwMzRjNWM4Mjg4M2ZmOTQ2NzdmN2ZhMTlkOTkyNjE0MjViZjg5ZWU5
14
+ MTU5N2VkOGFiOTcwMDRhYmI4ZTI5ZmM5ODA1OWZmOWRiYjVmZjAzMmQ0ODlk
15
+ Zjk2YTYwNDlhN2VhMTQ4ZmYzZDVmZTRjN2QxOGJjYTBhM2RmMzA=
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
+ - 1.8.7
4
5
  - 1.9.3
5
6
  - 2.0.0
6
7
  - jruby-19mode
@@ -13,6 +14,7 @@ gemfile:
13
14
 
14
15
  matrix:
15
16
  allow_failures:
17
+ - rvm: 1.8.7
16
18
  - rvm: jruby-19mode
17
19
 
18
20
  script: RAILS_ENV=test bundle exec rspec spec
@@ -1,3 +1,6 @@
1
+ # 0.6.3
2
+ * Use a mutex around access to the aggregator
3
+
1
4
  # 0.6.2
2
5
  * Bugfix in backtrace cleaner usage for Rails 4
3
6
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- source :rubygems
2
+ source 'https://rubygems.org'
3
3
 
4
4
  gem 'rails', '~> 3.0'
5
5
  gem 'rspec'
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- source :rubygems
2
+ source 'https://rubygems.org'
3
3
 
4
4
  gem 'rails', '~> 3.1'
5
5
  gem 'rspec'
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- source :rubygems
2
+ source 'https://rubygems.org'
3
3
 
4
4
  gem 'rails', '~> 3.2'
5
5
  gem 'rspec'
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- source :rubygems
2
+ source 'https://rubygems.org'
3
3
 
4
4
  gem 'rails', '~> 4.0'
5
5
  gem 'rspec'
@@ -2,12 +2,13 @@ module Appsignal
2
2
  class Agent
3
3
  ACTION = 'log_entries'.freeze
4
4
 
5
- attr_reader :aggregator, :thread, :active, :sleep_time, :transmitter
5
+ attr_reader :aggregator, :thread, :active, :sleep_time, :transmitter, :aggregator_semaphore
6
6
 
7
7
  def initialize
8
8
  return unless Appsignal.active?
9
9
  @sleep_time = 60.0
10
10
  @aggregator = Aggregator.new
11
+ @aggregator_semaphore = Mutex.new
11
12
  @retry_request = true
12
13
  @thread = Thread.new do
13
14
  while true do
@@ -25,15 +26,22 @@ module Appsignal
25
26
  end
26
27
 
27
28
  def enqueue(transaction)
28
- aggregator.add(transaction)
29
+ aggregator_semaphore.synchronize do
30
+ aggregator.add(transaction)
31
+ end
29
32
  end
30
33
 
31
34
  def send_queue
32
35
  Appsignal.logger.debug("Sending queue")
33
- current_aggregator = aggregator
34
- @aggregator = Aggregator.new
36
+ aggregator_to_be_sent = nil
37
+ aggregator_semaphore.synchronize do
38
+ aggregator_to_be_sent = aggregator
39
+ @aggregator = Aggregator.new
40
+ end
35
41
  begin
36
- handle_result transmitter.transmit(current_aggregator.post_processed_queue!)
42
+ handle_result(
43
+ transmitter.transmit(aggregator_to_be_sent.post_processed_queue!)
44
+ )
37
45
  rescue Exception => ex
38
46
  Appsignal.logger.error "#{ex.class} while sending queue: #{ex.message}"
39
47
  Appsignal.logger.error ex.backtrace.join('\n')
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.6.2'
2
+ VERSION = '0.6.3.beta.1'
3
3
  end
@@ -60,6 +60,6 @@ class AppsignalGenerator < Rails::Generators::Base
60
60
  def environments
61
61
  @environments ||= Dir.glob(
62
62
  File.join(%w(. config environments *.rb))
63
- ).map { |o| File.basename(o, ".rb").to_sym } - EXCLUDED_ENVIRONMENTS
63
+ ).map { |o| File.basename(o, ".rb") } - EXCLUDED_ENVIRONMENTS
64
64
  end
65
65
  end
@@ -3,7 +3,7 @@
3
3
  # Active environments count towards the account plan limit.
4
4
  <%- environments.each do |environment| -%>
5
5
  <%= environment %>:
6
- <%- if selected_environment.to_sym == environment -%>
6
+ <%- if selected_environment == environment -%>
7
7
  # The API key used by the AppSignal gem to push this specific environment to
8
8
  # AppSignal. (required)
9
9
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-08-03 00:00:00.000000000 Z
15
+ date: 2013-09-10 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rails
@@ -207,9 +207,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
207
  version: '0'
208
208
  required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  requirements:
210
- - - ! '>='
210
+ - - ! '>'
211
211
  - !ruby/object:Gem::Version
212
- version: '0'
212
+ version: 1.3.1
213
213
  requirements: []
214
214
  rubyforge_project:
215
215
  rubygems_version: 2.0.3