scout_apm 2.4.15 → 2.4.16

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: 28790463a370f23fbe18e2147ee6f930f9cb2e5c
4
- data.tar.gz: 73d2ada7c62fe31cdeac67101f1a2edee66a6577
3
+ metadata.gz: f3f60117002c54a06a541a4b23f585aa84ac6b71
4
+ data.tar.gz: 1452280fc1a2c1a9804d79a853dfbc34f1ab957e
5
5
  SHA512:
6
- metadata.gz: 65ec65774a64c65738bab1281ecfb800997991b8d95b8ab9ab2ee2748928afdb8e9ce0ed6480110d31a3f52e5f08ab11b80afbeca9bcc65b302979916f5a0e8a
7
- data.tar.gz: 0e77807792aa8f0650febc608365ae0821d3f6a34ed181704a331c63a064e3e3c3e83b94752e2f468ccdde66a12b4579ca2d8b6c06ddc6ab6bddb71c503f411c
6
+ metadata.gz: 693a5899262d98f0b78902f7694840ba6543643ae8ac4ad947fec3e5857470d9dee86842b5be970f6c7c1d93c4352c5cd0aec3c7688af096773d8a734659f163
7
+ data.tar.gz: b1861d620b74275e6387fe0b3ecce55a9596bc79f7499edcf6a216434afe252b724e596309a6bfac7b1293f3a4c69e881e64697803459b48ff0c263fd427687a
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.4.16
2
+
3
+ * Fix synchronization bug in Store (#205, PR #210)
4
+
1
5
  # 2.4.15
2
6
 
3
7
  * Fix bug that causes no data to be reported to Scout when DataDog is installed (#211)
@@ -5,8 +5,10 @@ module ScoutApm
5
5
  class Store
6
6
  def initialize(context)
7
7
  @context = context
8
- @mutex = Mutex.new
9
- @reporting_periods = Hash.new { |h,k| h[k] = StoreReportingPeriod.new(k, @context) }
8
+ @mutex = Monitor.new
9
+ @reporting_periods = Hash.new { |h,k|
10
+ @mutex.synchronize { h[k] = StoreReportingPeriod.new(k, @context) }
11
+ }
10
12
  @samplers = []
11
13
  end
12
14
 
@@ -87,8 +89,13 @@ module ScoutApm
87
89
  def write_to_layaway(layaway, force=false)
88
90
  logger.debug("Writing to layaway#{" (Forced)" if force}")
89
91
 
90
- @reporting_periods.select { |time, rp| force || (time.timestamp < current_timestamp.timestamp) }.
91
- each { |time, rp| write_reporting_period(layaway, time, rp) }
92
+ to_report = @mutex.synchronize {
93
+ @reporting_periods.select { |time, rp|
94
+ force || (time.timestamp < current_timestamp.timestamp)
95
+ }
96
+ }
97
+
98
+ to_report.each { |time, rp| write_reporting_period(layaway, time, rp) }
92
99
  end
93
100
 
94
101
  # For each tick (minute), be sure we have a reporting period, and that samplers are run for it.
@@ -98,14 +105,12 @@ module ScoutApm
98
105
  end
99
106
 
100
107
  def write_reporting_period(layaway, time, rp)
101
- @mutex.synchronize {
102
108
  layaway.write_reporting_period(rp)
103
- }
104
109
  rescue => e
105
110
  logger.warn("Failed writing data to layaway file: #{e.message} / #{e.backtrace}")
106
111
  ensure
107
112
  logger.debug("Before delete, reporting periods length: #{@reporting_periods.size}")
108
- deleted_items = @reporting_periods.delete(time)
113
+ deleted_items = @mutex.synchronize { @reporting_periods.delete(time) }
109
114
  logger.debug("After delete, reporting periods length: #{@reporting_periods.size}. Did delete #{deleted_items}")
110
115
  end
111
116
  private :write_reporting_period
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "2.4.15"
2
+ VERSION = "2.4.16"
3
3
  end
4
4
 
data/lib/scout_apm.rb CHANGED
@@ -6,6 +6,7 @@ end
6
6
  #####################################
7
7
  require 'cgi'
8
8
  require 'logger'
9
+ require 'monitor'
9
10
  require 'net/http'
10
11
  require 'openssl'
11
12
  require 'pp'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.15
4
+ version: 2.4.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-07 00:00:00.000000000 Z
12
+ date: 2018-08-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -390,8 +390,51 @@ required_rubygems_version: !ruby/object:Gem::Requirement
390
390
  version: '0'
391
391
  requirements: []
392
392
  rubyforge_project: scout_apm
393
- rubygems_version: 2.4.5.5
393
+ rubygems_version: 2.4.5.2
394
394
  signing_key:
395
395
  specification_version: 4
396
396
  summary: Ruby application performance monitoring
397
- test_files: []
397
+ test_files:
398
+ - test/data/config_test_1.yml
399
+ - test/test_helper.rb
400
+ - test/unit/agent_test.rb
401
+ - test/unit/background_job_integrations/sidekiq_test.rb
402
+ - test/unit/config_test.rb
403
+ - test/unit/context_test.rb
404
+ - test/unit/db_query_metric_set_test.rb
405
+ - test/unit/db_query_metric_stats_test.rb
406
+ - test/unit/environment_test.rb
407
+ - test/unit/extensions/periodic_callbacks_test.rb
408
+ - test/unit/extensions/transaction_callbacks_test.rb
409
+ - test/unit/fake_store_test.rb
410
+ - test/unit/git_revision_test.rb
411
+ - test/unit/histogram_test.rb
412
+ - test/unit/ignored_uris_test.rb
413
+ - test/unit/instruments/active_record_instruments_test.rb
414
+ - test/unit/instruments/net_http_test.rb
415
+ - test/unit/instruments/percentile_sampler_test.rb
416
+ - test/unit/layaway_test.rb
417
+ - test/unit/layer_children_set_test.rb
418
+ - test/unit/layer_converters/depth_first_walker_test.rb
419
+ - test/unit/layer_converters/metric_converter_test.rb
420
+ - test/unit/layer_converters/stubs.rb
421
+ - test/unit/limited_layer_test.rb
422
+ - test/unit/logger_test.rb
423
+ - test/unit/metric_set_test.rb
424
+ - test/unit/remote/test_message.rb
425
+ - test/unit/remote/test_router.rb
426
+ - test/unit/remote/test_server.rb
427
+ - test/unit/scored_item_set_test.rb
428
+ - test/unit/serializers/payload_serializer_test.rb
429
+ - test/unit/slow_job_policy_test.rb
430
+ - test/unit/slow_request_policy_test.rb
431
+ - test/unit/sql_sanitizer_test.rb
432
+ - test/unit/store_test.rb
433
+ - test/unit/tracer_test.rb
434
+ - test/unit/tracked_request_test.rb
435
+ - test/unit/transaction_test.rb
436
+ - test/unit/transaction_time_consumed_test.rb
437
+ - test/unit/utils/active_record_metric_name_test.rb
438
+ - test/unit/utils/backtrace_parser_test.rb
439
+ - test/unit/utils/numbers_test.rb
440
+ - test/unit/utils/scm.rb