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 +4 -4
- data/CHANGELOG.markdown +5 -0
- data/lib/scout_apm/agent/reporting.rb +1 -1
- data/lib/scout_apm/app_server_load.rb +9 -9
- data/lib/scout_apm/framework_integrations/rails_2.rb +6 -2
- data/lib/scout_apm/framework_integrations/rails_3_or_4.rb +6 -2
- data/lib/scout_apm/framework_integrations/ruby.rb +4 -0
- data/lib/scout_apm/framework_integrations/sinatra.rb +4 -0
- data/lib/scout_apm/reporter.rb +3 -1
- data/lib/scout_apm/store.rb +3 -1
- data/lib/scout_apm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9841d34d8ea8772e1f432ea8902b87adca2eca5
|
4
|
+
data.tar.gz: cb278b70b62479d3039893a62fa797f7769b8d17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41c7e87187b02c3e5013f74316059569eb0a5c62208c45eb4881bac47993ad5162f36c9bc8ff3f8e97cf1dd70c91fdb62d2caaa900ecab3633b7eee758fb9606
|
7
|
+
data.tar.gz: 74cd457db440e285c645ab045a11ed6da76aefa7e8d95847a61f1e19640337684b6c56ebf0407992c50a7c397fcde16208630074c0424283dfe3573109cbb9cb
|
data/CHANGELOG.markdown
CHANGED
@@ -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
|
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
|
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(
|
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
|
20
|
-
framework
|
21
|
-
framework_version
|
22
|
-
ruby_version
|
23
|
-
hostname
|
24
|
-
database_engine
|
25
|
-
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
|
-
|
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
|
-
|
24
|
+
::Rails.application.class.to_s.
|
25
|
+
sub(/::Application$/, '')
|
22
26
|
end
|
23
27
|
rescue
|
24
28
|
nil
|
data/lib/scout_apm/reporter.rb
CHANGED
@@ -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
|
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
|
data/lib/scout_apm/store.rb
CHANGED
@@ -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
|
data/lib/scout_apm/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|