scout_apm 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91a0c14d41ab0d56bce566a96e08014a452ba693
4
- data.tar.gz: 8b1f7239c3f43bfaa1cb6191ff20d8bcc29bd288
3
+ metadata.gz: a9841d34d8ea8772e1f432ea8902b87adca2eca5
4
+ data.tar.gz: cb278b70b62479d3039893a62fa797f7769b8d17
5
5
  SHA512:
6
- metadata.gz: 0f11acf434f45f02d92106f76d7976aa13c86808a10e5716d6698660f82889a9de4a374060acaa5c170df182b60eb9943226da10478f76c33e6ac02bebd4bde6
7
- data.tar.gz: baa5db394ee68a07b26fae9a493a96f0e512c6dbc0c583082b2eb5974dfdbd946632c11d83b914cd8033c60f85b3cebc94bccb44b18153f3f95d478fa801c487
6
+ metadata.gz: 41c7e87187b02c3e5013f74316059569eb0a5c62208c45eb4881bac47993ad5162f36c9bc8ff3f8e97cf1dd70c91fdb62d2caaa900ecab3633b7eee758fb9606
7
+ data.tar.gz: 74cd457db440e285c645ab045a11ed6da76aefa7e8d95847a61f1e19640337684b6c56ebf0407992c50a7c397fcde16208630074c0424283dfe3573109cbb9cb
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.1.8
2
+
3
+ * Ping APM on Application Load
4
+ * Fix compatibility with Ruby 1.8 and 1.9
5
+
1
6
  # 0.1.7
2
7
 
3
8
  * Ability to ignore child calls in instrumentation.
@@ -73,7 +73,7 @@ module ScoutApm
73
73
  @samplers.each do |sampler|
74
74
  begin
75
75
  result = sampler.run
76
- store.track!(sampler.metric_name, result, scope: nil) if result
76
+ store.track!(sampler.metric_name, result, {:scope => nil}) if result
77
77
  rescue => e
78
78
  logger.info "Error reading #{sampler.human_name}"
79
79
  logger.debug e.message
@@ -2,27 +2,27 @@ module ScoutApm
2
2
  class AppServerLoad
3
3
  attr_reader :logger
4
4
 
5
- def initialize(logger: Agent.instance.logger)
5
+ def initialize(logger=Agent.instance.logger)
6
6
  @logger = logger
7
7
  end
8
8
 
9
9
  def run
10
10
  logger.info("Sending Startup Info: #{data.inspect}")
11
11
  payload = ScoutApm::Serializers::AppServerLoadSerializer.serialize(data)
12
- reporter = Reporter.new(type: :app_server_load)
12
+ reporter = Reporter.new(:app_server_load)
13
13
  reporter.report(payload)
14
14
  rescue => e
15
15
  logger.debug("Failed Startup Info - #{e.message} \n\t#{e.backtrace.join("\t\n")}")
16
16
  end
17
17
 
18
18
  def data
19
- { server_time: Time.now,
20
- framework: ScoutApm::Environment.instance.framework_integration.name,
21
- framework_version: ScoutApm::Environment.instance.framework_integration.version,
22
- ruby_version: RUBY_VERSION,
23
- hostname: ScoutApm::Environment.instance.hostname,
24
- database_engine: ScoutApm::Environment.instance.database_engine,
25
- application_name: ScoutApm::Environment.instance.application_name,
19
+ { :server_time => Time.now,
20
+ :framework => ScoutApm::Environment.instance.framework_integration.human_name,
21
+ :framework_version => ScoutApm::Environment.instance.framework_integration.version,
22
+ :ruby_version => RUBY_VERSION,
23
+ :hostname => ScoutApm::Environment.instance.hostname,
24
+ :database_engine => ScoutApm::Environment.instance.database_engine,
25
+ :application_name => ScoutApm::Environment.instance.application_name,
26
26
  }
27
27
  end
28
28
  end
@@ -5,6 +5,10 @@ module ScoutApm
5
5
  :rails
6
6
  end
7
7
 
8
+ def human_name
9
+ "Rails"
10
+ end
11
+
8
12
  def version
9
13
  Rails::VERSION::STRING
10
14
  end
@@ -17,8 +21,8 @@ module ScoutApm
17
21
 
18
22
  def application_name
19
23
  if defined?(::Rails)
20
- ::Rails.application.class.to_s
21
- .sub(/::Application$/, '')
24
+ ::Rails.application.class.to_s.
25
+ sub(/::Application$/, '')
22
26
  end
23
27
  rescue
24
28
  nil
@@ -5,6 +5,10 @@ module ScoutApm
5
5
  :rails3_or_4
6
6
  end
7
7
 
8
+ def human_name
9
+ "Rails"
10
+ end
11
+
8
12
  def version
9
13
  Rails::VERSION::STRING
10
14
  end
@@ -17,8 +21,8 @@ module ScoutApm
17
21
 
18
22
  def application_name
19
23
  if defined?(::Rails)
20
- ::Rails.application.class.to_s
21
- .sub(/::Application$/, '')
24
+ ::Rails.application.class.to_s.
25
+ sub(/::Application$/, '')
22
26
  end
23
27
  rescue
24
28
  nil
@@ -5,6 +5,10 @@ module ScoutApm
5
5
  :ruby
6
6
  end
7
7
 
8
+ def human_name
9
+ "Ruby"
10
+ end
11
+
8
12
  def version
9
13
  "Unknown"
10
14
  end
@@ -5,6 +5,10 @@ module ScoutApm
5
5
  :sinatra
6
6
  end
7
7
 
8
+ def human_name
9
+ "Sinatra"
10
+ end
11
+
8
12
  def version
9
13
  Sinatra::VERSION
10
14
  end
@@ -1,3 +1,5 @@
1
+ require 'openssl'
2
+
1
3
  module ScoutApm
2
4
  class Reporter
3
5
  CA_FILE = File.join( File.dirname(__FILE__), *%w[.. .. data cacert.pem] )
@@ -7,7 +9,7 @@ module ScoutApm
7
9
  attr_reader :logger
8
10
  attr_reader :type
9
11
 
10
- def initialize(config=Agent.instance.config, logger=Agent.instance.logger, type: :checkin)
12
+ def initialize(config=Agent.instance.config, logger=Agent.instance.logger, type = :checkin)
11
13
  @config = config
12
14
  @logger = logger
13
15
  @type = type
@@ -1,3 +1,5 @@
1
+ require 'thread'
2
+
1
3
  # The store encapsolutes the logic that (1) saves instrumented data by Metric name to memory and (2) maintains a stack (just an Array)
2
4
  # of instrumented methods that are being called. It's accessed via +ScoutApm::Agent.instance.store+.
3
5
  class ScoutApm::Store
@@ -149,7 +151,7 @@ class ScoutApm::Store
149
151
  # Options:
150
152
  # :scope => If provided, overrides the default scope.
151
153
  # :exclusive_time => Sets the exclusive time for the method. If not provided, uses +call_time+.
152
- def track!(metric_name,call_time,options = {})
154
+ def track!(metric_name, call_time, options = {})
153
155
  meta = ScoutApm::MetricMeta.new(metric_name)
154
156
  meta.scope = options[:scope] if options.has_key?(:scope)
155
157
  stat = metric_hash[meta] || ScoutApm::MetricStats.new
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
4
4
 
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: 0.1.7
4
+ version: 0.1.8
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: 2015-08-26 00:00:00.000000000 Z
12
+ date: 2015-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest