scout_apm 2.2.0.pre3 → 2.3.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/CHANGELOG.markdown +147 -2
- data/Guardfile +43 -0
- data/Rakefile +2 -2
- data/ext/allocations/allocations.c +6 -0
- data/ext/allocations/extconf.rb +1 -0
- data/ext/rusage/README.md +26 -0
- data/ext/rusage/extconf.rb +5 -0
- data/ext/rusage/rusage.c +52 -0
- data/lib/scout_apm.rb +28 -15
- data/lib/scout_apm/agent.rb +89 -37
- data/lib/scout_apm/agent/logging.rb +6 -1
- data/lib/scout_apm/agent/reporting.rb +9 -6
- data/lib/scout_apm/app_server_load.rb +21 -10
- data/lib/scout_apm/attribute_arranger.rb +6 -3
- data/lib/scout_apm/background_job_integrations/delayed_job.rb +71 -1
- data/lib/scout_apm/background_job_integrations/resque.rb +85 -0
- data/lib/scout_apm/background_job_integrations/sidekiq.rb +22 -20
- data/lib/scout_apm/background_recorder.rb +43 -0
- data/lib/scout_apm/background_worker.rb +19 -15
- data/lib/scout_apm/config.rb +138 -28
- data/lib/scout_apm/db_query_metric_set.rb +80 -0
- data/lib/scout_apm/db_query_metric_stats.rb +102 -0
- data/lib/scout_apm/debug.rb +37 -0
- data/lib/scout_apm/environment.rb +22 -15
- data/lib/scout_apm/git_revision.rb +51 -0
- data/lib/scout_apm/histogram.rb +11 -2
- data/lib/scout_apm/instant/assets/xmlhttp_instrumentation.html +2 -2
- data/lib/scout_apm/instant/middleware.rb +196 -54
- data/lib/scout_apm/instruments/action_controller_rails_3_rails4.rb +89 -68
- data/lib/scout_apm/instruments/action_view.rb +49 -0
- data/lib/scout_apm/instruments/active_record.rb +127 -3
- data/lib/scout_apm/instruments/grape.rb +4 -3
- data/lib/scout_apm/instruments/middleware_detailed.rb +4 -6
- data/lib/scout_apm/instruments/mongoid.rb +24 -3
- data/lib/scout_apm/instruments/net_http.rb +7 -2
- data/lib/scout_apm/instruments/percentile_sampler.rb +36 -19
- data/lib/scout_apm/instruments/process/process_cpu.rb +3 -2
- data/lib/scout_apm/instruments/process/process_memory.rb +3 -3
- data/lib/scout_apm/instruments/resque.rb +40 -0
- data/lib/scout_apm/layaway.rb +67 -28
- data/lib/scout_apm/layer.rb +19 -59
- data/lib/scout_apm/layer_children_set.rb +77 -0
- data/lib/scout_apm/layer_converters/allocation_metric_converter.rb +5 -6
- data/lib/scout_apm/layer_converters/converter_base.rb +201 -14
- data/lib/scout_apm/layer_converters/database_converter.rb +55 -0
- data/lib/scout_apm/layer_converters/depth_first_walker.rb +22 -10
- data/lib/scout_apm/layer_converters/error_converter.rb +5 -7
- data/lib/scout_apm/layer_converters/find_layer_by_type.rb +34 -0
- data/lib/scout_apm/layer_converters/histograms.rb +14 -0
- data/lib/scout_apm/layer_converters/job_converter.rb +36 -50
- data/lib/scout_apm/layer_converters/metric_converter.rb +17 -19
- data/lib/scout_apm/layer_converters/request_queue_time_converter.rb +10 -12
- data/lib/scout_apm/layer_converters/slow_job_converter.rb +41 -115
- data/lib/scout_apm/layer_converters/slow_request_converter.rb +33 -117
- data/lib/scout_apm/limited_layer.rb +126 -0
- data/lib/scout_apm/metric_meta.rb +0 -5
- data/lib/scout_apm/metric_set.rb +9 -1
- data/lib/scout_apm/metric_stats.rb +7 -8
- data/lib/scout_apm/rack.rb +26 -0
- data/lib/scout_apm/remote/message.rb +23 -0
- data/lib/scout_apm/remote/recorder.rb +57 -0
- data/lib/scout_apm/remote/router.rb +49 -0
- data/lib/scout_apm/remote/server.rb +58 -0
- data/lib/scout_apm/reporter.rb +51 -15
- data/lib/scout_apm/request_histograms.rb +4 -0
- data/lib/scout_apm/request_manager.rb +2 -1
- data/lib/scout_apm/scored_item_set.rb +7 -0
- data/lib/scout_apm/serializers/db_query_serializer_to_json.rb +15 -0
- data/lib/scout_apm/serializers/histograms_serializer_to_json.rb +21 -0
- data/lib/scout_apm/serializers/payload_serializer.rb +10 -3
- data/lib/scout_apm/serializers/payload_serializer_to_json.rb +6 -6
- data/lib/scout_apm/serializers/slow_jobs_serializer_to_json.rb +2 -1
- data/lib/scout_apm/server_integrations/puma.rb +5 -2
- data/lib/scout_apm/slow_job_policy.rb +1 -10
- data/lib/scout_apm/slow_job_record.rb +6 -1
- data/lib/scout_apm/slow_request_policy.rb +1 -10
- data/lib/scout_apm/slow_transaction.rb +20 -2
- data/lib/scout_apm/store.rb +66 -12
- data/lib/scout_apm/synchronous_recorder.rb +26 -0
- data/lib/scout_apm/tracked_request.rb +136 -71
- data/lib/scout_apm/utils/active_record_metric_name.rb +8 -4
- data/lib/scout_apm/utils/backtrace_parser.rb +3 -3
- data/lib/scout_apm/utils/gzip_helper.rb +24 -0
- data/lib/scout_apm/utils/numbers.rb +14 -0
- data/lib/scout_apm/utils/scm.rb +14 -0
- data/lib/scout_apm/version.rb +1 -1
- data/scout_apm.gemspec +5 -4
- data/test/test_helper.rb +18 -0
- data/test/unit/config_test.rb +59 -8
- data/test/unit/db_query_metric_set_test.rb +56 -0
- data/test/unit/db_query_metric_stats_test.rb +113 -0
- data/test/unit/git_revision_test.rb +15 -0
- data/test/unit/histogram_test.rb +14 -0
- data/test/unit/instruments/net_http_test.rb +21 -0
- data/test/unit/instruments/percentile_sampler_test.rb +137 -0
- data/test/unit/layaway_test.rb +20 -0
- data/test/unit/layer_children_set_test.rb +88 -0
- data/test/unit/layer_converters/depth_first_walker_test.rb +66 -0
- data/test/unit/layer_converters/metric_converter_test.rb +22 -0
- data/test/unit/layer_converters/stubs.rb +33 -0
- data/test/unit/limited_layer_test.rb +53 -0
- data/test/unit/remote/test_message.rb +13 -0
- data/test/unit/remote/test_router.rb +33 -0
- data/test/unit/remote/test_server.rb +15 -0
- data/test/unit/serializers/payload_serializer_test.rb +3 -12
- data/test/unit/store_test.rb +66 -0
- data/test/unit/test_tracked_request.rb +87 -0
- data/test/unit/utils/active_record_metric_name_test.rb +8 -0
- data/test/unit/utils/backtrace_parser_test.rb +5 -0
- data/test/unit/utils/numbers_test.rb +15 -0
- data/test/unit/utils/scm.rb +17 -0
- metadata +125 -30
- data/ext/stacks/extconf.rb +0 -37
- data/ext/stacks/scout_atomics.h +0 -86
- data/ext/stacks/stacks.c +0 -811
- data/lib/scout_apm/capacity.rb +0 -57
- data/lib/scout_apm/deploy_integrations/capistrano_2.cap +0 -12
- data/lib/scout_apm/deploy_integrations/capistrano_2.rb +0 -83
- data/lib/scout_apm/deploy_integrations/capistrano_3.cap +0 -12
- data/lib/scout_apm/deploy_integrations/capistrano_3.rb +0 -88
- data/lib/scout_apm/instruments/delayed_job.rb +0 -57
- data/lib/scout_apm/serializers/deploy_serializer.rb +0 -16
- data/lib/scout_apm/trace_compactor.rb +0 -312
- data/lib/scout_apm/utils/fake_stacks.rb +0 -87
- data/tester.rb +0 -53
@@ -1,87 +0,0 @@
|
|
1
|
-
# A fake implementation of the allocations native extension, for systems that don't support it.
|
2
|
-
module ScoutApm
|
3
|
-
module Instruments
|
4
|
-
class Stacks
|
5
|
-
ENABLED = false
|
6
|
-
|
7
|
-
class << self
|
8
|
-
def install(*args)
|
9
|
-
# noop
|
10
|
-
end
|
11
|
-
|
12
|
-
def uninstall(*args)
|
13
|
-
# noop
|
14
|
-
end
|
15
|
-
|
16
|
-
def start(*args)
|
17
|
-
# noop
|
18
|
-
end
|
19
|
-
|
20
|
-
def add_profiled_thread(*args)
|
21
|
-
# noop
|
22
|
-
end
|
23
|
-
|
24
|
-
def remove_profiled_thread(*args)
|
25
|
-
# noop
|
26
|
-
end
|
27
|
-
|
28
|
-
def profile_frames(*args)
|
29
|
-
[] # frames that were profiled (none)
|
30
|
-
end
|
31
|
-
|
32
|
-
def start_sampling(*args)
|
33
|
-
# noop
|
34
|
-
end
|
35
|
-
|
36
|
-
def stop_sampling(*args)
|
37
|
-
# noop
|
38
|
-
end
|
39
|
-
|
40
|
-
def update_indexes(*args)
|
41
|
-
# noop
|
42
|
-
true
|
43
|
-
end
|
44
|
-
|
45
|
-
def current_trace_index(*args)
|
46
|
-
:opaque_value
|
47
|
-
end
|
48
|
-
|
49
|
-
def current_frame_index(*args)
|
50
|
-
:opaque_value
|
51
|
-
end
|
52
|
-
|
53
|
-
def frame_klass(*args)
|
54
|
-
nil
|
55
|
-
end
|
56
|
-
|
57
|
-
def frame_method(*args)
|
58
|
-
nil
|
59
|
-
end
|
60
|
-
|
61
|
-
def frame_file(*args)
|
62
|
-
nil
|
63
|
-
end
|
64
|
-
|
65
|
-
def frame_lineno(*args)
|
66
|
-
nil
|
67
|
-
end
|
68
|
-
|
69
|
-
def skipped_in_gc(*args)
|
70
|
-
0
|
71
|
-
end
|
72
|
-
|
73
|
-
def skipped_in_handler(*args)
|
74
|
-
0
|
75
|
-
end
|
76
|
-
|
77
|
-
def skipped_in_job_registered(*args)
|
78
|
-
0
|
79
|
-
end
|
80
|
-
|
81
|
-
def skipped_in_not_running(*args)
|
82
|
-
0
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
data/tester.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
$: << "./lib"
|
2
|
-
|
3
|
-
require 'scout_apm'
|
4
|
-
require 'stacks'
|
5
|
-
|
6
|
-
class OneTrace
|
7
|
-
attr_reader :data
|
8
|
-
attr_reader :num
|
9
|
-
|
10
|
-
def initialize(num)
|
11
|
-
puts "Initialized, expecting #{num}"
|
12
|
-
@num = num
|
13
|
-
@data = []
|
14
|
-
end
|
15
|
-
|
16
|
-
def add(file, line, label, klass)
|
17
|
-
@data << [file, line, label, klass]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
class GlobalVar
|
22
|
-
def self.collect(trace)
|
23
|
-
puts "***************************************************************"
|
24
|
-
|
25
|
-
puts "Collected some data in ruby:\n#{trace.data.map{|x| "#{x[0]}:#{x[1]}\t#{x[3]}##{x[2]}" }.join("\n")}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
####################################
|
30
|
-
#
|
31
|
-
def quux
|
32
|
-
while true
|
33
|
-
puts "Hello"
|
34
|
-
sleep 0.5
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
class Whipple
|
39
|
-
def baz
|
40
|
-
quux
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def bar
|
45
|
-
w = Whipple.new
|
46
|
-
w.baz
|
47
|
-
end
|
48
|
-
|
49
|
-
def foo
|
50
|
-
bar
|
51
|
-
end
|
52
|
-
|
53
|
-
foo
|