appoptics_apm 4.0.3 → 4.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile_test +6 -7
- data/README.md +3 -3
- data/Rakefile +3 -2
- data/appoptics_apm.gemspec +2 -2
- data/docker-compose.yml +0 -22
- data/ext/oboe_metal/extconf.rb +4 -0
- data/lib/appoptics_apm/config.rb +11 -6
- data/lib/appoptics_apm/version.rb +1 -1
- metadata +3 -202
- data/gemfiles/delayed_job.gemfile +0 -36
- data/gemfiles/frameworks.gemfile +0 -44
- data/gemfiles/instrumentation_mocked.gemfile +0 -29
- data/gemfiles/libraries.gemfile +0 -85
- data/gemfiles/noop.gemfile +0 -17
- data/gemfiles/rails23.gemfile +0 -39
- data/gemfiles/rails30.gemfile +0 -42
- data/gemfiles/rails31.gemfile +0 -44
- data/gemfiles/rails32.gemfile +0 -54
- data/gemfiles/rails40.gemfile +0 -27
- data/gemfiles/rails41.gemfile +0 -27
- data/gemfiles/rails42.gemfile +0 -35
- data/gemfiles/rails50.gemfile +0 -44
- data/gemfiles/rails51.gemfile +0 -44
- data/test/benchmark/README.md +0 -65
- data/test/benchmark/logging_bench.rb +0 -54
- data/test/benchmark/with_libraries_gemfile/bunny_bench.rb +0 -69
- data/test/benchmark/with_rails5x_gemfile/action_controller5x_bench.rb +0 -43
- data/test/frameworks/apps/grape_nested.rb +0 -33
- data/test/frameworks/apps/grape_simple.rb +0 -80
- data/test/frameworks/apps/padrino_simple.rb +0 -80
- data/test/frameworks/apps/sinatra_simple.rb +0 -55
- data/test/frameworks/grape_test.rb +0 -286
- data/test/frameworks/padrino_test.rb +0 -222
- data/test/frameworks/rails3x_test.rb +0 -554
- data/test/frameworks/rails4x_test.rb +0 -570
- data/test/frameworks/rails5x_api_test.rb +0 -210
- data/test/frameworks/rails5x_test.rb +0 -376
- data/test/frameworks/rails_shared_tests.rb +0 -172
- data/test/frameworks/sinatra_test.rb +0 -140
- data/test/instrumentation/bunny_client_test.rb +0 -276
- data/test/instrumentation/bunny_consumer_test.rb +0 -204
- data/test/instrumentation/curb_test.rb +0 -398
- data/test/instrumentation/dalli_test.rb +0 -177
- data/test/instrumentation/em_http_request_test.rb +0 -89
- data/test/instrumentation/excon_test.rb +0 -231
- data/test/instrumentation/faraday_test.rb +0 -228
- data/test/instrumentation/http_test.rb +0 -143
- data/test/instrumentation/httpclient_test.rb +0 -304
- data/test/instrumentation/memcache_test.rb +0 -260
- data/test/instrumentation/memcached_test.rb +0 -229
- data/test/instrumentation/mongo_v1_test.rb +0 -479
- data/test/instrumentation/mongo_v2_index_test.rb +0 -124
- data/test/instrumentation/mongo_v2_test.rb +0 -584
- data/test/instrumentation/mongo_v2_view_test.rb +0 -435
- data/test/instrumentation/moped_test.rb +0 -517
- data/test/instrumentation/rack_test.rb +0 -165
- data/test/instrumentation/redis_hashes_test.rb +0 -268
- data/test/instrumentation/redis_keys_test.rb +0 -321
- data/test/instrumentation/redis_lists_test.rb +0 -310
- data/test/instrumentation/redis_misc_test.rb +0 -163
- data/test/instrumentation/redis_sets_test.rb +0 -296
- data/test/instrumentation/redis_sortedsets_test.rb +0 -328
- data/test/instrumentation/redis_strings_test.rb +0 -349
- data/test/instrumentation/resque_test.rb +0 -185
- data/test/instrumentation/rest-client_test.rb +0 -288
- data/test/instrumentation/sequel_mysql2_test.rb +0 -353
- data/test/instrumentation/sequel_mysql_test.rb +0 -334
- data/test/instrumentation/sequel_pg_test.rb +0 -336
- data/test/instrumentation/sidekiq-client_test.rb +0 -159
- data/test/instrumentation/sidekiq-worker_test.rb +0 -180
- data/test/instrumentation/twitter-cassandra_test.rb +0 -424
- data/test/instrumentation/typhoeus_test.rb +0 -284
- data/test/jobs/delayed_job/db_worker_job.rb +0 -29
- data/test/jobs/delayed_job/error_worker_job.rb +0 -10
- data/test/jobs/delayed_job/remote_call_worker_job.rb +0 -20
- data/test/jobs/resque/db_worker_job.rb +0 -29
- data/test/jobs/resque/error_worker_job.rb +0 -10
- data/test/jobs/resque/remote_call_worker_job.rb +0 -20
- data/test/jobs/sidekiq/db_worker_job.rb +0 -29
- data/test/jobs/sidekiq/error_worker_job.rb +0 -10
- data/test/jobs/sidekiq/remote_call_worker_job.rb +0 -20
- data/test/minitest_helper.rb +0 -277
- data/test/mocked/curb_mocked_test.rb +0 -324
- data/test/mocked/excon_mocked_test.rb +0 -174
- data/test/mocked/faraday_mocked_test.rb +0 -97
- data/test/mocked/http_mocked_test.rb +0 -135
- data/test/mocked/httpclient_mocked_test.rb +0 -258
- data/test/mocked/rest_client_mocked_test.rb +0 -109
- data/test/mocked/typhoeus_mocked_test.rb +0 -207
- data/test/models/widget.rb +0 -36
- data/test/noop/noop_test.rb +0 -145
- data/test/profiling/legacy_method_profiling_test.rb +0 -201
- data/test/profiling/method_profiling_test.rb +0 -631
- data/test/queues/delayed_job-client_test.rb +0 -95
- data/test/queues/delayed_job-worker_test.rb +0 -91
- data/test/reporter/reporter_test.rb +0 -14
- data/test/servers/delayed_job.rb +0 -107
- data/test/servers/rackapp_8101.rb +0 -29
- data/test/servers/rails3x_8140.rb +0 -96
- data/test/servers/rails4x_8140.rb +0 -96
- data/test/servers/rails5x_8140.rb +0 -95
- data/test/servers/rails5x_api_8150.rb +0 -78
- data/test/servers/sidekiq.rb +0 -29
- data/test/servers/sidekiq.yml +0 -7
- data/test/servers/sidekiq_initializer.rb +0 -25
- data/test/settings +0 -0
- data/test/support/auto_tracing_test.rb +0 -50
- data/test/support/backcompat_test.rb +0 -276
- data/test/support/config_test.rb +0 -149
- data/test/support/dnt_test.rb +0 -98
- data/test/support/init_report_test.rb +0 -25
- data/test/support/liboboe_settings_test.rb +0 -110
- data/test/support/logging_test.rb +0 -130
- data/test/support/sql_sanitize_test.rb +0 -55
- data/test/support/tracing_mode_test.rb +0 -33
- data/test/support/tvalias_test.rb +0 -15
- data/test/support/xtrace_test.rb +0 -41
@@ -1,55 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
require 'minitest_helper'
|
5
|
-
|
6
|
-
class SQLSanitizeTest < Minitest::Test
|
7
|
-
def test_sanitize_sql1
|
8
|
-
AppOpticsAPM::Config[:sanitize_sql] = true
|
9
|
-
|
10
|
-
sql = "INSERT INTO `queries` (`asdf_id`, `asdf_prices`, `created_at`, `updated_at`, `blue_pill`, `yearly_tax`, `rate`, `steam_id`, `red_pill`, `dimitri`, `origin`) VALUES (19231, 3, 'cat', 'dog', 111.0, 126.0, 116.0, 79.0, 72.0, 73.0, ?, 1, 3, 229.284, ?, ?, 100, ?, 0, 3, 1, ?, NULL, NULL, ?, 4, ?)"
|
11
|
-
result = AppOpticsAPM::Util.sanitize_sql(sql)
|
12
|
-
result.must_equal "INSERT INTO `queries` (`asdf_id`, `asdf_prices`, `created_at`, `updated_at`, `blue_pill`, `yearly_tax`, `rate`, `steam_id`, `red_pill`, `dimitri`, `origin`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
|
13
|
-
|
14
|
-
AppOpticsAPM::Config[:sanitize_sql] = false
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_sanitize_sql2
|
18
|
-
AppOpticsAPM::Config[:sanitize_sql] = true
|
19
|
-
|
20
|
-
sql = "SELECT \"game_types\".* FROM \"game_types\" WHERE \"game_types\".\"game_id\" IN (1162)"
|
21
|
-
result = AppOpticsAPM::Util.sanitize_sql(sql)
|
22
|
-
result.must_equal "SELECT \"game_types\".* FROM \"game_types\" WHERE \"game_types\".\"game_id\" IN (?)"
|
23
|
-
|
24
|
-
AppOpticsAPM::Config[:sanitize_sql] = false
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_sanitize_sql3
|
28
|
-
AppOpticsAPM::Config[:sanitize_sql] = true
|
29
|
-
|
30
|
-
sql = "SELECT \"comments\".* FROM \"comments\" WHERE \"comments\".\"commentable_id\" = 2798 AND \"comments\".\"commentable_type\" = 'Video' AND \"comments\".\"parent_id\" IS NULL ORDER BY comments.created_at DESC"
|
31
|
-
result = AppOpticsAPM::Util.sanitize_sql(sql)
|
32
|
-
result.must_equal "SELECT \"comments\".* FROM \"comments\" WHERE \"comments\".\"commentable_id\" = ? AND \"comments\".\"commentable_type\" = ? AND \"comments\".\"parent_id\" IS ? ORDER BY comments.created_at DESC"
|
33
|
-
|
34
|
-
AppOpticsAPM::Config[:sanitize_sql] = false
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_sanitize_sql4
|
38
|
-
AppOpticsAPM::Config[:sanitize_sql] = true
|
39
|
-
|
40
|
-
sql = "SELECT `assets`.* FROM `assets` WHERE `assets`.`type` IN ('Picture') AND (updated_at >= '2015-07-08 19:22:00') AND (updated_at <= '2015-07-08 19:23:00') LIMIT 31 OFFSET 0"
|
41
|
-
result = AppOpticsAPM::Util.sanitize_sql(sql)
|
42
|
-
result.must_equal "SELECT `assets`.* FROM `assets` WHERE `assets`.`type` IN (?) AND (updated_at >= ?) AND (updated_at <= ?) LIMIT ? OFFSET ?"
|
43
|
-
|
44
|
-
AppOpticsAPM::Config[:sanitize_sql] = false
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_dont_sanitize
|
48
|
-
AppOpticsAPM::Config[:sanitize_sql] = false
|
49
|
-
|
50
|
-
sql = "SELECT `assets`.* FROM `assets` WHERE `assets`.`type` IN ('Picture') AND (updated_at >= '2015-07-08 19:22:00') AND (updated_at <= '2015-07-08 19:23:00') LIMIT 31 OFFSET 0"
|
51
|
-
result = AppOpticsAPM::Util.sanitize_sql(sql)
|
52
|
-
result.must_equal "SELECT `assets`.* FROM `assets` WHERE `assets`.`type` IN ('Picture') AND (updated_at >= '2015-07-08 19:22:00') AND (updated_at <= '2015-07-08 19:23:00') LIMIT 31 OFFSET 0"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
require 'minitest_helper'
|
5
|
-
|
6
|
-
class TracingModeTest < Minitest::Test
|
7
|
-
def setup
|
8
|
-
@tm = AppOpticsAPM::Config[:tracing_mode]
|
9
|
-
AppOpticsAPM::Config[:tracing_mode] = :always
|
10
|
-
end
|
11
|
-
|
12
|
-
def teardown
|
13
|
-
AppOpticsAPM::Config[:tracing_mode] = @tm
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_trace_when_always
|
17
|
-
AppOpticsAPM::API.start_trace(:test_always) do
|
18
|
-
AppOpticsAPM.tracing?.must_equal true
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_dont_trace_when_never
|
23
|
-
AppOpticsAPM::Config[:tracing_mode] = :never
|
24
|
-
|
25
|
-
AppOpticsAPM::API.start_trace(:test_never) do
|
26
|
-
AppOpticsAPM.tracing?.must_equal false
|
27
|
-
end
|
28
|
-
|
29
|
-
AppOpticsAPM::API.start_trace('asdf') do
|
30
|
-
AppOpticsAPM.tracing?.must_equal false
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
require 'minitest_helper'
|
5
|
-
|
6
|
-
class APPOPTICSAliasTest < Minitest::Test
|
7
|
-
|
8
|
-
def test_responds_various_capitalization
|
9
|
-
defined?(::AppOpticsAPM).must_equal "constant"
|
10
|
-
defined?(::AppOpticsAPM).must_equal "constant"
|
11
|
-
|
12
|
-
AppOpticsAPM.methods.count.must_equal AppOpticsAPM.methods.count
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
data/test/support/xtrace_test.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
require 'minitest_helper'
|
5
|
-
|
6
|
-
describe "XTrace" do
|
7
|
-
|
8
|
-
it 'should correctly validate X-Trace IDs' do
|
9
|
-
# Invalid X-Trace IDs
|
10
|
-
AppOpticsAPM::XTrace.valid?("").must_equal false
|
11
|
-
AppOpticsAPM::XTrace.valid?(nil).must_equal false
|
12
|
-
AppOpticsAPM::XTrace.valid?("2B00000000000000000000000000000000000000000000000000000000").must_equal false
|
13
|
-
AppOpticsAPM::XTrace.valid?("2b").must_equal false
|
14
|
-
AppOpticsAPM::XTrace.valid?("29348209348").must_equal false
|
15
|
-
|
16
|
-
# Legacy X-Trace IDs are not valid anymore
|
17
|
-
AppOpticsAPM::XTrace.valid?("1B7435A9FE510AE4533414D425DADF4E180D2B4E3649E60702469DB05F").must_equal false
|
18
|
-
|
19
|
-
# Standard X-Trace IDs
|
20
|
-
AppOpticsAPM::XTrace.valid?("2B7435A9FE510AE4533414D425DADF4E180D2B4E3649E60702469DB05F00").must_equal true
|
21
|
-
AppOpticsAPM::XTrace.valid?("2BA462ADE6CFE479081764CC476AA983351DC51B1BCB3468DA6F06EEFA01").must_equal true
|
22
|
-
AppOpticsAPM::XTrace.valid?("2BADFDFB3DBA36323B2E0975925D0DAE12D10BA5946809504DC4B81FF601").must_equal true
|
23
|
-
|
24
|
-
# X-Trace IDs with lower-case alpha chars
|
25
|
-
AppOpticsAPM::XTrace.valid?("2bf9861cb12e2a257247a8195654e56d30b2f4e2d4fce67c321ad5849500").must_equal true
|
26
|
-
AppOpticsAPM::XTrace.valid?("2b258b2c1d6914f3c6085cb72e7cc93e145b401d4356aa24ef7294b2d600").must_equal true
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should correctly extract task IDs from X-Trace IDs' do
|
30
|
-
task_id = AppOpticsAPM::XTrace.task_id("2BF86B3D3342FCECAECE33C6411379BB171505DB6A136DFAEBDF74236200")
|
31
|
-
task_id.is_a?(String).must_equal true
|
32
|
-
task_id.must_equal "F86B3D3342FCECAECE33C6411379BB171505DB6A"
|
33
|
-
task_id.length.must_equal 40
|
34
|
-
|
35
|
-
task_id = AppOpticsAPM::XTrace.task_id("2B77970F82332EE22FF04C249FCBA8F63E8AFA2C6730E209453259B2D601")
|
36
|
-
task_id.is_a?(String).must_equal true
|
37
|
-
task_id.must_equal "77970F82332EE22FF04C249FCBA8F63E8AFA2C67"
|
38
|
-
task_id.length.must_equal 40
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|