newrelic_rpm 3.7.2.195 → 3.7.3.199
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +25 -1
- data/Rakefile +7 -0
- data/lib/new_relic/agent/agent.rb +19 -13
- data/lib/new_relic/agent/configuration/default_source.rb +23 -0
- data/lib/new_relic/agent/cross_app_tracing.rb +2 -0
- data/lib/new_relic/agent/database.rb +123 -94
- data/lib/new_relic/agent/database/obfuscation_helpers.rb +37 -0
- data/lib/new_relic/agent/database/obfuscator.rb +65 -0
- data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +49 -0
- data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +2 -1
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +9 -8
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -38
- data/lib/new_relic/agent/instrumentation/rubyprof.rb +26 -0
- data/lib/new_relic/agent/instrumentation/typhoeus.rb +3 -2
- data/lib/new_relic/agent/pipe_channel_manager.rb +45 -12
- data/lib/new_relic/agent/pipe_service.rb +14 -8
- data/lib/new_relic/agent/request_sampler.rb +63 -6
- data/lib/new_relic/agent/sampler_collection.rb +5 -2
- data/lib/new_relic/agent/shim_agent.rb +1 -1
- data/lib/new_relic/agent/transaction.rb +41 -22
- data/lib/new_relic/agent/transaction_sample_builder.rb +0 -4
- data/lib/new_relic/agent/transaction_sampler.rb +2 -5
- data/lib/new_relic/agent/transaction_state.rb +43 -11
- data/lib/new_relic/agent/vm.rb +32 -0
- data/lib/new_relic/agent/vm/jruby_vm.rb +40 -0
- data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +36 -0
- data/lib/new_relic/agent/vm/mri_vm.rb +86 -0
- data/lib/new_relic/agent/vm/rubinius_vm.rb +40 -0
- data/lib/new_relic/agent/vm/snapshot.rb +16 -0
- data/lib/new_relic/control.rb +0 -6
- data/lib/new_relic/language_support.rb +20 -0
- data/lib/new_relic/latest_changes.rb +41 -12
- data/lib/new_relic/rack/developer_mode.rb +8 -1
- data/lib/new_relic/rack/transaction_reset.rb +1 -1
- data/lib/new_relic/transaction_sample.rb +0 -13
- data/lib/new_relic/version.rb +1 -1
- data/lib/tasks/install.rake +5 -0
- data/newrelic_rpm.gemspec +2 -1
- data/test/active_record_fixtures.rb +7 -9
- data/test/agent_helper.rb +11 -50
- data/test/environments/lib/environments/runner.rb +3 -5
- data/test/environments/rails40/Gemfile +12 -3
- data/test/environments/rails41/Gemfile +34 -0
- data/test/environments/rails41/Rakefile +11 -0
- data/test/environments/rails41/config/application.rb +18 -0
- data/test/environments/rails41/config/boot.rb +10 -0
- data/test/environments/rails41/config/database.yml +26 -0
- data/test/environments/rails41/config/environment.rb +6 -0
- data/test/environments/rails41/db/schema.rb +5 -0
- data/test/fixtures/cross_agent_tests/README.md +12 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.colon_obfuscated.txt +3 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.explain.txt +3 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.obfuscated.txt +3 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/current_date.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/current_date.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/current_date.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/current_date.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/date.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/date.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/date.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/date.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_newline.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_newline.explain.txt +3 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_newline.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_newline.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_quote.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_quote.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_quote.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_quote.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/floating_point.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/floating_point.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/floating_point.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/floating_point.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/function_with_strings.colon_obfuscated.txt +5 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/function_with_strings.explain.txt +5 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/function_with_strings.obfuscated.txt +5 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/function_with_strings.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/quote_in_table_name.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/quote_in_table_name.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/quote_in_table_name.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/quote_in_table_name.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/subplan.colon_obfuscated.txt +5 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/subplan.explain.txt +5 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/subplan.obfuscated.txt +5 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/subplan.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_integer.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_integer.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_integer.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_integer.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_regex_chars.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_regex_chars.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_regex_chars.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_regex_chars.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_substring.colon_obfuscated.txt +3 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_substring.explain.txt +3 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_substring.obfuscated.txt +3 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_substring.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case1.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case1.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case1.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case1.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case2.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case2.explain.txt +3 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case2.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case2.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case3.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case3.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case3.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case3.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case4.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case4.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case4.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case4.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case5.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case5.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case5.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case5.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case6.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case6.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case6.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case6.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case7.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case7.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case7.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case7.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case8.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case8.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case8.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case8.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case9.colon_obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case9.explain.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case9.obfuscated.txt +2 -0
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case9.query.txt +1 -0
- data/test/fixtures/cross_agent_tests/rules.json +165 -0
- data/test/fixtures/cross_agent_tests/rum_client_config.json +142 -0
- data/test/fixtures/cross_agent_tests/rum_cookie.json +17 -0
- data/test/fixtures/cross_agent_tests/rum_footer_insertion_location/close-body-in-comment.html +10 -0
- data/test/fixtures/cross_agent_tests/rum_footer_insertion_location/dynamic-iframe.html +19 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/basic.html +10 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/body_with_attributes.html +3 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/charset_tag.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/charset_tag_after_x_ua_tag.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/charset_tag_before_x_ua_tag.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/charset_tag_with_spaces.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/comments1.html +24 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/comments2.html +24 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/content_type_charset_tag.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/content_type_charset_tag_after_x_ua_tag.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/content_type_charset_tag_before_x_ua_tag.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_quotes1.html +27 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_quotes2.html +24 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_quotes_mismatch.html +24 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_single_quotes1.html +25 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_single_quotes_mismatch.html +25 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/head_with_attributes.html +10 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/incomplete_non_meta_tags.html +10 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_header.html +7 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_html_and_no_header.html +3 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_start_header.html +9 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/script1.html +19 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/script2.html +17 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag.html +10 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_multiline.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_spaces_around_equals.html +10 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_with_others.html +11 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_with_spaces.html +10 -0
- data/test/fixtures/cross_agent_tests/sql_parsing.json +55 -0
- data/test/fixtures/cross_agent_tests/url_clean.json +15 -0
- data/test/fixtures/cross_agent_tests/url_domain_extraction.json +35 -0
- data/test/flaky_proxy/README.md +91 -33
- data/test/flaky_proxy/lib/flaky_proxy.rb +1 -0
- data/test/flaky_proxy/lib/flaky_proxy/http_message.rb +2 -0
- data/test/flaky_proxy/lib/flaky_proxy/proxy.rb +19 -4
- data/test/flaky_proxy/lib/flaky_proxy/rule.rb +13 -16
- data/test/flaky_proxy/lib/flaky_proxy/rule_set.rb +10 -2
- data/test/flaky_proxy/lib/flaky_proxy/sequence.rb +14 -0
- data/test/helpers/file_searching.rb +1 -1
- data/test/intentional_fail.rb +1 -1
- data/test/multiverse/lib/multiverse/suite.rb +26 -3
- data/test/multiverse/suites/active_record/Envfile +1 -1
- data/test/multiverse/suites/active_record/ar_method_aliasing.rb +1 -1
- data/test/multiverse/suites/agent_only/audit_log_test.rb +1 -1
- data/test/multiverse/suites/agent_only/collector_exception_handling_test.rb +1 -1
- data/test/multiverse/suites/agent_only/cross_application_tracing_test.rb +1 -1
- data/test/multiverse/suites/agent_only/encoding_handling_test.rb +1 -1
- data/test/multiverse/suites/agent_only/harvest_timestamps_test.rb +1 -1
- data/test/multiverse/suites/agent_only/http_response_code_test.rb +1 -1
- data/test/multiverse/suites/agent_only/key_transactions_test.rb +1 -1
- data/test/multiverse/suites/agent_only/logging_test.rb +1 -1
- data/test/multiverse/suites/agent_only/marshaling_test.rb +1 -1
- data/test/multiverse/suites/agent_only/pipe_manager_test.rb +1 -1
- data/test/multiverse/suites/agent_only/rename_rule_test.rb +1 -1
- data/test/multiverse/suites/agent_only/rum_instrumentation_test.rb +1 -1
- data/test/multiverse/suites/agent_only/service_timeout_test.rb +1 -1
- data/test/multiverse/suites/agent_only/set_transaction_name_test.rb +1 -1
- data/test/multiverse/suites/agent_only/ssl_test.rb +1 -1
- data/test/multiverse/suites/agent_only/start_up_test.rb +1 -1
- data/test/multiverse/suites/agent_only/thread_profiling_test.rb +1 -1
- data/test/multiverse/suites/agent_only/xray_sessions_test.rb +1 -1
- data/test/multiverse/suites/bare/standalone_instrumentation_test.rb +1 -1
- data/test/multiverse/suites/config_file_loading/config_file_loading_test.rb +1 -1
- data/test/multiverse/suites/curb/curb_test.rb +1 -1
- data/test/multiverse/suites/datamapper/datamapper_test.rb +1 -1
- data/test/multiverse/suites/deferred_instrumentation/sinatra_test.rb +1 -1
- data/test/multiverse/suites/excon/excon_test.rb +1 -1
- data/test/multiverse/suites/httpclient/httpclient_test.rb +1 -1
- data/test/multiverse/suites/mongo/helpers/mongo_operation_tests.rb +7 -3
- data/test/multiverse/suites/mongo/mongo_instrumentation_test.rb +1 -1
- data/test/multiverse/suites/mongo/mongo_unsupported_version_test.rb +2 -2
- data/test/multiverse/suites/net_http/net_http_test.rb +1 -1
- data/test/multiverse/suites/padrino/Envfile +1 -1
- data/test/multiverse/suites/padrino/padrino_test.rb +1 -1
- data/test/multiverse/suites/rails/Envfile +10 -0
- data/test/multiverse/suites/rails/request_statistics_test.rb +59 -6
- data/test/multiverse/suites/rails/view_instrumentation_test.rb +1 -0
- data/test/multiverse/suites/resque/instrumentation_test.rb +1 -1
- data/test/multiverse/suites/sequel/sequel_instrumentation_test.rb +5 -18
- data/test/multiverse/suites/sequel/sequel_safety_test.rb +1 -1
- data/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +1 -1
- data/test/multiverse/suites/sinatra/ignoring_test.rb +1 -1
- data/test/multiverse/suites/sinatra/sinatra_classic_test.rb +1 -1
- data/test/multiverse/suites/sinatra/sinatra_error_tracing_test.rb +1 -1
- data/test/multiverse/suites/sinatra/sinatra_metric_explosion_test.rb +1 -1
- data/test/multiverse/suites/sinatra/sinatra_modular_test.rb +1 -1
- data/test/multiverse/suites/sinatra/sinatra_routes_test.rb +1 -1
- data/test/multiverse/suites/typhoeus/typhoeus_test.rb +36 -2
- data/test/new_relic/FAKECHANGELOG +21 -0
- data/test/new_relic/agent/agent/connect_test.rb +1 -1
- data/test/new_relic/agent/agent/start_test.rb +1 -1
- data/test/new_relic/agent/agent/start_worker_thread_test.rb +1 -1
- data/test/new_relic/agent/agent_logger_test.rb +1 -1
- data/test/new_relic/agent/agent_test.rb +14 -8
- data/test/new_relic/agent/apdex_from_server_test.rb +1 -1
- data/test/new_relic/agent/audit_logger_test.rb +1 -1
- data/test/new_relic/agent/autostart_test.rb +1 -1
- data/test/new_relic/agent/browser_token_test.rb +1 -1
- data/test/new_relic/agent/busy_calculator_test.rb +1 -1
- data/test/new_relic/agent/commands/agent_command_router_test.rb +1 -1
- data/test/new_relic/agent/commands/agent_command_test.rb +1 -1
- data/test/new_relic/agent/commands/thread_profiler_session_test.rb +2 -2
- data/test/new_relic/agent/commands/xray_session_collection_test.rb +1 -1
- data/test/new_relic/agent/commands/xray_session_test.rb +1 -1
- data/test/new_relic/agent/configuration/default_source_test.rb +1 -1
- data/test/new_relic/agent/configuration/environment_source_test.rb +1 -1
- data/test/new_relic/agent/configuration/manager_test.rb +1 -1
- data/test/new_relic/agent/configuration/orphan_configuration_test.rb +1 -1
- data/test/new_relic/agent/configuration/server_source_test.rb +1 -1
- data/test/new_relic/agent/configuration/yaml_source_test.rb +1 -1
- data/test/new_relic/agent/cpu_sampler_test.rb +1 -1
- data/test/new_relic/agent/cross_app_monitor_test.rb +3 -3
- data/test/new_relic/agent/cross_app_tracing_test.rb +1 -1
- data/test/new_relic/agent/database/postgres_explain_obfuscator_test.rb +34 -0
- data/test/new_relic/agent/database_test.rb +192 -5
- data/test/new_relic/agent/datastores/mongo/metric_generator_test.rb +1 -1
- data/test/new_relic/agent/datastores/mongo/metric_translator_test.rb +11 -1
- data/test/new_relic/agent/datastores/mongo/obfuscator_test.rb +1 -1
- data/test/new_relic/agent/datastores/mongo/statement_formatter_test.rb +1 -1
- data/test/new_relic/agent/error_collector/notice_error_test.rb +1 -1
- data/test/new_relic/agent/error_collector_test.rb +1 -1
- data/test/new_relic/agent/event_listener_test.rb +1 -1
- data/test/new_relic/agent/harvester_test.rb +1 -1
- data/test/new_relic/agent/http_clients/uri_util_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/action_controller_subscriber_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/action_view_subscriber_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/active_record_helper_test.rb +4 -4
- data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +2 -2
- data/test/new_relic/agent/instrumentation/active_record_test.rb +385 -0
- data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/instrumentation_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/metric_frame_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/queue_time_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/rack_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/sinatra/transaction_namer_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/sinatra_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +1 -1
- data/test/new_relic/agent/javascript_instrumentor_test.rb +3 -3
- data/test/new_relic/agent/memcache_instrumentation_test.rb +1 -1
- data/test/new_relic/agent/memory_logger_test.rb +1 -1
- data/test/new_relic/agent/method_interrobang_test.rb +1 -1
- data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +1 -1
- data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +1 -1
- data/test/new_relic/agent/method_tracer_test.rb +1 -1
- data/test/new_relic/agent/method_visibility_test.rb +1 -1
- data/test/new_relic/agent/new_relic_service_test.rb +2 -2
- data/test/new_relic/agent/obfuscator_test.rb +1 -1
- data/test/new_relic/agent/pipe_channel_manager_test.rb +216 -143
- data/test/new_relic/agent/pipe_service_test.rb +26 -15
- data/test/new_relic/agent/request_sampler_test.rb +65 -18
- data/test/new_relic/agent/rpm_agent_test.rb +1 -1
- data/test/new_relic/agent/rules_engine_test.rb +1 -1
- data/test/new_relic/agent/sampled_buffer_test.rb +1 -1
- data/test/new_relic/agent/sampler_collection_test.rb +8 -1
- data/test/new_relic/agent/sampler_test.rb +1 -1
- data/test/new_relic/agent/shim_agent_test.rb +3 -3
- data/test/new_relic/agent/sql_sampler_test.rb +7 -6
- data/test/new_relic/agent/stats_engine/gc_profiler_test.rb +1 -1
- data/test/new_relic/agent/stats_engine/metric_stats_test.rb +1 -1
- data/test/new_relic/agent/stats_engine/samplers_test.rb +1 -1
- data/test/new_relic/agent/stats_engine_test.rb +1 -1
- data/test/new_relic/agent/stats_hash_test.rb +1 -1
- data/test/new_relic/agent/stats_test.rb +1 -1
- data/test/new_relic/agent/threading/agent_thread_test.rb +1 -1
- data/test/new_relic/agent/threading/backtrace_node_test.rb +1 -1
- data/test/new_relic/agent/threading/backtrace_service_test.rb +3 -3
- data/test/new_relic/agent/threading/thread_profile_test.rb +1 -1
- data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction/force_persist_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction/pop_test.rb +1 -1
- data/test/new_relic/agent/transaction/slowest_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction/xray_sample_buffer_test.rb +1 -1
- data/test/new_relic/agent/transaction_interrobang_test.rb +1 -1
- data/test/new_relic/agent/transaction_sample_builder_test.rb +1 -1
- data/test/new_relic/agent/transaction_sampler_test.rb +17 -17
- data/test/new_relic/agent/transaction_state_test.rb +61 -6
- data/test/new_relic/agent/transaction_test.rb +60 -3
- data/test/new_relic/agent/transaction_timings_test.rb +1 -1
- data/test/new_relic/agent/vm/monotonic_gc_profiler_test.rb +42 -0
- data/test/new_relic/agent/vm/mri_vm_test.rb +35 -0
- data/test/new_relic/agent/vm/snapshot_test.rb +8 -0
- data/test/new_relic/agent/vm_test.rb +48 -0
- data/test/new_relic/agent/worker_loop_test.rb +1 -1
- data/test/new_relic/agent_test.rb +1 -1
- data/test/new_relic/cli/deployments_test.rb +1 -1
- data/test/new_relic/coerce_test.rb +1 -1
- data/test/new_relic/collection_helper_test.rb +1 -1
- data/test/new_relic/control/class_methods_test.rb +1 -1
- data/test/new_relic/control/frameworks/rails_test.rb +1 -1
- data/test/new_relic/control_test.rb +1 -1
- data/test/new_relic/dependency_detection_test.rb +1 -1
- data/test/new_relic/dispatcher_test.rb +1 -1
- data/test/new_relic/environment_report_test.rb +1 -1
- data/test/new_relic/framework_test.rb +1 -1
- data/test/new_relic/http_client_test_cases.rb +1 -1
- data/test/new_relic/json_wrapper_test.rb +1 -1
- data/test/new_relic/language_support_test.rb +42 -1
- data/test/new_relic/latest_changes_test.rb +45 -0
- data/test/new_relic/license_test.rb +2 -2
- data/test/new_relic/load_test.rb +1 -1
- data/test/new_relic/local_environment_test.rb +1 -1
- data/test/new_relic/metric_data_test.rb +1 -1
- data/test/new_relic/metric_parser/metric_parser_test.rb +1 -1
- data/test/new_relic/metric_spec_test.rb +1 -1
- data/test/new_relic/multiverse_helpers.rb +0 -27
- data/test/new_relic/noticed_error_test.rb +1 -1
- data/test/new_relic/rack/agent_hooks_test.rb +1 -1
- data/test/new_relic/rack/all_test.rb +1 -1
- data/test/new_relic/rack/browser_monitoring_test.rb +2 -2
- data/test/new_relic/rack/deferred_instrumentation_test.rb +1 -1
- data/test/new_relic/rack/developer_mode_helper_test.rb +1 -1
- data/test/new_relic/rack/developer_mode_test.rb +2 -19
- data/test/new_relic/rack/error_collector_test.rb +1 -1
- data/test/new_relic/rack/transaction_reset_test.rb +1 -1
- data/test/new_relic/transaction_analysis/segment_summary_test.rb +1 -1
- data/test/new_relic/transaction_analysis_test.rb +1 -1
- data/test/new_relic/transaction_sample/composite_segment_test.rb +1 -1
- data/test/new_relic/transaction_sample/fake_segment_test.rb +1 -1
- data/test/new_relic/transaction_sample/segment_test.rb +2 -2
- data/test/new_relic/transaction_sample/summary_segment_test.rb +1 -1
- data/test/new_relic/transaction_sample_subtest_test.rb +1 -1
- data/test/new_relic/transaction_sample_test.rb +3 -3
- data/test/new_relic/version_number_test.rb +1 -1
- data/test/performance/lib/performance/instrumentation/stackprof.rb +33 -0
- data/test/performance/lib/performance/platform.rb +1 -0
- data/test/performance/suites/marshalling.rb +2 -1
- data/test/test_helper.rb +33 -3
- data/ui/views/newrelic/index.rhtml +2 -2
- metadata +169 -31
- metadata.gz.sig +0 -0
- data/lib/new_relic/control/profiling.rb +0 -29
- data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +0 -648
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper'))
|
6
6
|
|
7
|
-
class PipeServiceTest <
|
7
|
+
class PipeServiceTest < Minitest::Test
|
8
8
|
def setup
|
9
9
|
NewRelic::Agent::PipeChannelManager.listener.stop
|
10
10
|
NewRelic::Agent::PipeChannelManager.register_report_channel(:pipe_service_test)
|
@@ -45,7 +45,7 @@ class PipeServiceTest < MiniTest::Unit::TestCase
|
|
45
45
|
@service.metric_data(metric_data0)
|
46
46
|
end
|
47
47
|
|
48
|
-
assert_equal 'Custom/something', received_data[:
|
48
|
+
assert_equal 'Custom/something', received_data[:metric_data].keys.sort[0].name
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_transaction_sample_data
|
@@ -53,21 +53,36 @@ class PipeServiceTest < MiniTest::Unit::TestCase
|
|
53
53
|
@service.transaction_sample_data(['txn'])
|
54
54
|
end
|
55
55
|
|
56
|
-
assert_equal ['txn'], received_data[:
|
56
|
+
assert_equal ['txn'], received_data[:transaction_sample_data]
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_error_data
|
60
60
|
received_data = data_from_forked_process do
|
61
61
|
@service.error_data(['err'])
|
62
62
|
end
|
63
|
-
assert_equal ['err'], received_data[:
|
63
|
+
assert_equal ['err'], received_data[:error_data]
|
64
64
|
end
|
65
65
|
|
66
66
|
def test_sql_trace_data
|
67
67
|
received_data = data_from_forked_process do
|
68
68
|
@service.sql_trace_data(['sql'])
|
69
69
|
end
|
70
|
-
assert_equal ['sql'], received_data[:
|
70
|
+
assert_equal ['sql'], received_data[:sql_trace_data]
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_analytic_event_data
|
74
|
+
received_data = data_from_forked_process do
|
75
|
+
@service.analytic_event_data(['events'])
|
76
|
+
end
|
77
|
+
assert_equal ['events'], received_data[:analytic_event_data]
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_transaction_sample_data_with_newlines
|
81
|
+
payload_with_newline = "foo\n\nbar"
|
82
|
+
received_data = data_from_forked_process do
|
83
|
+
@service.transaction_sample_data([payload_with_newline])
|
84
|
+
end
|
85
|
+
assert_equal [payload_with_newline], received_data[:transaction_sample_data]
|
71
86
|
end
|
72
87
|
|
73
88
|
def test_multiple_writes_to_pipe
|
@@ -83,9 +98,9 @@ class PipeServiceTest < MiniTest::Unit::TestCase
|
|
83
98
|
|
84
99
|
received_data = read_from_pipe
|
85
100
|
|
86
|
-
assert_equal 'Custom/something', received_data[:
|
87
|
-
assert_equal ['txn0'], received_data[:
|
88
|
-
assert_equal ['err0'], received_data[:
|
101
|
+
assert_equal 'Custom/something', received_data[:metric_data].keys.sort[0].name
|
102
|
+
assert_equal ['txn0'], received_data[:transaction_sample_data]
|
103
|
+
assert_equal ['err0'], received_data[:error_data].sort
|
89
104
|
end
|
90
105
|
|
91
106
|
def test_shutdown_closes_pipe
|
@@ -105,14 +120,10 @@ class PipeServiceTest < MiniTest::Unit::TestCase
|
|
105
120
|
|
106
121
|
def read_from_pipe
|
107
122
|
pipe = NewRelic::Agent::PipeChannelManager.channels[:pipe_service_test]
|
108
|
-
pipe.in.close
|
109
123
|
data = {}
|
110
|
-
while payload = pipe.
|
111
|
-
|
112
|
-
|
113
|
-
got = {:EOF => 'EOF'}
|
114
|
-
end
|
115
|
-
data.merge!(got)
|
124
|
+
while payload = pipe.read
|
125
|
+
endpoint, data_for_endpoint = Marshal.load(payload)
|
126
|
+
data.merge!(endpoint => data_for_endpoint)
|
116
127
|
end
|
117
128
|
data
|
118
129
|
end
|
@@ -7,7 +7,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper
|
|
7
7
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','data_container_tests'))
|
8
8
|
require 'new_relic/agent/request_sampler'
|
9
9
|
|
10
|
-
class NewRelic::Agent::RequestSamplerTest <
|
10
|
+
class NewRelic::Agent::RequestSamplerTest < Minitest::Test
|
11
11
|
|
12
12
|
def setup
|
13
13
|
freeze_time
|
@@ -50,7 +50,6 @@ class NewRelic::Agent::RequestSamplerTest < MiniTest::Unit::TestCase
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
|
54
53
|
def test_includes_custom_parameters_in_event
|
55
54
|
with_sampler_config do
|
56
55
|
generate_request('whatever', :custom_params => {'bing' => 2})
|
@@ -69,26 +68,83 @@ class NewRelic::Agent::RequestSamplerTest < MiniTest::Unit::TestCase
|
|
69
68
|
|
70
69
|
def test_custom_parameters_in_event_cant_override_reserved_attributes
|
71
70
|
with_sampler_config do
|
71
|
+
metrics = NewRelic::Agent::StatsHash.new()
|
72
|
+
metrics.record(NewRelic::MetricSpec.new('HttpDispatcher'), 0.01)
|
73
|
+
|
72
74
|
generate_request('whatever',
|
73
|
-
:
|
74
|
-
:custom_params => {'type' => 'giraffe', 'duration' => 'hippo'
|
75
|
+
:metrics => metrics,
|
76
|
+
:custom_params => {'type' => 'giraffe', 'duration' => 'hippo'}
|
75
77
|
)
|
76
78
|
txn_event = single_sample[EVENT_DATA_INDEX]
|
77
79
|
assert_equal 'Transaction', txn_event['type']
|
78
80
|
assert_equal 0.1, txn_event['duration']
|
79
|
-
assert_equal 0.01, txn_event['webDuration']
|
80
81
|
|
81
82
|
custom_attrs = single_sample[CUSTOM_ATTRIBUTES_INDEX]
|
82
83
|
assert_equal 'giraffe', custom_attrs['type']
|
83
84
|
assert_equal 'hippo', custom_attrs['duration']
|
84
|
-
assert_equal 'zebra', custom_attrs['webDuration']
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
-
def
|
88
|
+
def test_samples_on_transaction_finished_event_includes_expected_web_metrics
|
89
|
+
stats_hash = NewRelic::Agent::StatsHash.new
|
90
|
+
stats_hash.record(NewRelic::MetricSpec.new('WebFrontend/QueueTime'), 13)
|
91
|
+
stats_hash.record(NewRelic::MetricSpec.new('External/allWeb'), 14)
|
92
|
+
stats_hash.record(NewRelic::MetricSpec.new('Datastore/all'), 15)
|
93
|
+
stats_hash.record(NewRelic::MetricSpec.new("GC/cumulative"), 16)
|
94
|
+
stats_hash.record(NewRelic::MetricSpec.new('Memcache/allWeb'), 17)
|
95
|
+
|
96
|
+
with_sampler_config do
|
97
|
+
generate_request('name', :metrics => stats_hash)
|
98
|
+
event_data = single_sample[EVENT_DATA_INDEX]
|
99
|
+
assert_equal 13, event_data["queueDuration"]
|
100
|
+
assert_equal 14, event_data["externalDuration"]
|
101
|
+
assert_equal 15, event_data["databaseDuration"]
|
102
|
+
assert_equal 16, event_data["gcCumulative"]
|
103
|
+
assert_equal 17, event_data["memcacheDuration"]
|
104
|
+
|
105
|
+
assert_equal 1, event_data["externalCallCount"]
|
106
|
+
assert_equal 1, event_data["databaseCallCount"]
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_samples_on_transaction_finished_includes_expected_background_metrics
|
111
|
+
stats_hash = NewRelic::Agent::StatsHash.new
|
112
|
+
stats_hash.record(NewRelic::MetricSpec.new('External/allOther'), 12)
|
113
|
+
stats_hash.record(NewRelic::MetricSpec.new('Datastore/all'), 13)
|
114
|
+
stats_hash.record(NewRelic::MetricSpec.new('Memcache/allOther'), 14)
|
115
|
+
|
116
|
+
with_sampler_config do
|
117
|
+
generate_request('name', :metrics => stats_hash)
|
118
|
+
|
119
|
+
event_data = single_sample[EVENT_DATA_INDEX]
|
120
|
+
assert_equal 12, event_data["externalDuration"]
|
121
|
+
assert_equal 13, event_data["databaseDuration"]
|
122
|
+
assert_equal 14, event_data["memcacheDuration"]
|
123
|
+
|
124
|
+
assert_equal 1, event_data["databaseCallCount"]
|
125
|
+
assert_equal 1, event_data["externalCallCount"]
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_samples_on_transaction_finished_event_includes_guid
|
130
|
+
with_sampler_config do
|
131
|
+
generate_request('name', :guid => "GUID")
|
132
|
+
assert_equal "GUID", single_sample[EVENT_DATA_INDEX]["nr.guid"]
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def test_samples_on_transaction_finished_event_includes_referring_transaction_guid
|
89
137
|
with_sampler_config do
|
90
|
-
generate_request('name', :
|
91
|
-
assert_equal
|
138
|
+
generate_request('name', :referring_transaction_guid=> "REFER")
|
139
|
+
assert_equal "REFER", single_sample[EVENT_DATA_INDEX]["nr.referringTransactionGuid"]
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
def test_records_background_tasks
|
144
|
+
with_sampler_config do
|
145
|
+
generate_request('a', :type => :controller)
|
146
|
+
generate_request('b', :type => :background)
|
147
|
+
assert_equal 2, @sampler.samples.size
|
92
148
|
end
|
93
149
|
end
|
94
150
|
|
@@ -155,14 +211,6 @@ class NewRelic::Agent::RequestSamplerTest < MiniTest::Unit::TestCase
|
|
155
211
|
end
|
156
212
|
end
|
157
213
|
|
158
|
-
def test_does_not_record_requests_from_background_tasks
|
159
|
-
with_sampler_config do
|
160
|
-
generate_request('a', :type => :controller)
|
161
|
-
generate_request('b', :type => :background)
|
162
|
-
assert_equal 1, @sampler.samples.size
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
214
|
def test_does_not_drop_samples_when_used_from_multiple_threads
|
167
215
|
with_sampler_config( :'analytics_events.max_samples_stored' => 100 * 100 ) do
|
168
216
|
threads = []
|
@@ -187,7 +235,6 @@ class NewRelic::Agent::RequestSamplerTest < MiniTest::Unit::TestCase
|
|
187
235
|
:type => :controller,
|
188
236
|
:start_timestamp => Time.now.to_f,
|
189
237
|
:duration => 0.1,
|
190
|
-
:overview_metrics => {},
|
191
238
|
:custom_params => {}
|
192
239
|
}.merge(options)
|
193
240
|
@event_listener.notify(:transaction_finished, payload)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
|
6
6
|
|
7
|
-
class NewRelic::Agent::SampledBufferTest <
|
7
|
+
class NewRelic::Agent::SampledBufferTest < Minitest::Test
|
8
8
|
def test_should_keep_all_samples_up_to_capacity
|
9
9
|
buffer = NewRelic::Agent::SampledBuffer.new(100)
|
10
10
|
all = []
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
|
6
6
|
|
7
|
-
class SamplerCollectionTest <
|
7
|
+
class SamplerCollectionTest < Minitest::Test
|
8
8
|
|
9
9
|
class DummySampler
|
10
10
|
attr_reader :id
|
@@ -49,6 +49,13 @@ class SamplerCollectionTest < MiniTest::Unit::TestCase
|
|
49
49
|
assert_equal(0, @collection.to_a.size)
|
50
50
|
end
|
51
51
|
|
52
|
+
def test_add_sampler_calls_setup_events_with_event_listener_if_present
|
53
|
+
sampler = DummySampler.new
|
54
|
+
DummySampler.stubs(:new).returns(sampler)
|
55
|
+
sampler.expects(:setup_events).with(@events)
|
56
|
+
@collection.add_sampler(DummySampler)
|
57
|
+
end
|
58
|
+
|
52
59
|
def test_poll_samplers_polls_samplers
|
53
60
|
@collection.add_sampler(DummySampler)
|
54
61
|
@collection.add_sampler(DummySampler2)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper'))
|
6
|
-
class NewRelic::Agent::SamplerTest <
|
6
|
+
class NewRelic::Agent::SamplerTest < Minitest::Test
|
7
7
|
require 'new_relic/agent/sampler'
|
8
8
|
|
9
9
|
def test_inherited_should_append_subclasses_to_sampler_classes
|
@@ -5,15 +5,15 @@
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
|
6
6
|
module NewRelic
|
7
7
|
module Agent
|
8
|
-
class ShimAgentTest <
|
8
|
+
class ShimAgentTest < Minitest::Test
|
9
9
|
|
10
10
|
def setup
|
11
11
|
super
|
12
12
|
@agent = NewRelic::Agent::ShimAgent.new
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
assert_equal(nil, @agent.
|
15
|
+
def test_merge_data_for_endpoint
|
16
|
+
assert_equal(nil, @agent.merge_data_for_endpoint(:diggle, mock('metric data')))
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
|
6
6
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','data_container_tests'))
|
7
7
|
|
8
|
-
class NewRelic::Agent::SqlSamplerTest <
|
8
|
+
class NewRelic::Agent::SqlSamplerTest < Minitest::Test
|
9
9
|
def setup
|
10
10
|
agent = NewRelic::Agent.instance
|
11
11
|
stats_engine = NewRelic::Agent::StatsEngine.new
|
@@ -139,23 +139,24 @@ class NewRelic::Agent::SqlSamplerTest < MiniTest::Unit::TestCase
|
|
139
139
|
|
140
140
|
def test_harvest_should_collect_explain_plans
|
141
141
|
@connection.expects(:execute).with("EXPLAIN select * from test") \
|
142
|
-
.returns(
|
142
|
+
.returns(dummy_mysql_explain_result({"header0" => 'foo0', "header1" => 'foo1', "header2" => 'foo2'}))
|
143
143
|
@connection.expects(:execute).with("EXPLAIN select * from test2") \
|
144
|
-
.returns(
|
144
|
+
.returns(dummy_mysql_explain_result({"header0" => 'bar0', "header1" => 'bar1', "header2" => 'bar2'}))
|
145
145
|
|
146
146
|
data = NewRelic::Agent::TransactionSqlData.new
|
147
147
|
data.set_transaction_info("/c/a", {}, 'guid')
|
148
148
|
data.set_transaction_name("WebTransaction/Controller/c/a")
|
149
149
|
explainer = NewRelic::Agent::Instrumentation::ActiveRecord::EXPLAINER
|
150
|
+
config = { :adapter => 'mysql' }
|
150
151
|
queries = [
|
151
152
|
NewRelic::Agent::SlowSql.new("select * from test",
|
152
|
-
"Database/test/select",
|
153
|
+
"Database/test/select", config,
|
153
154
|
1.5, nil, &explainer),
|
154
155
|
NewRelic::Agent::SlowSql.new("select * from test",
|
155
|
-
"Database/test/select",
|
156
|
+
"Database/test/select", config,
|
156
157
|
1.2, nil, &explainer),
|
157
158
|
NewRelic::Agent::SlowSql.new("select * from test2",
|
158
|
-
"Database/test2/select",
|
159
|
+
"Database/test2/select", config,
|
159
160
|
1.1, nil, &explainer)
|
160
161
|
]
|
161
162
|
data.sql_data.concat(queries)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))
|
6
6
|
|
7
|
-
class NewRelic::Agent::StatsEngine::GCProfilerTest <
|
7
|
+
class NewRelic::Agent::StatsEngine::GCProfilerTest < Minitest::Test
|
8
8
|
def test_init_profiler_for_rails_bench
|
9
9
|
return unless defined?(::GC) && ::GC.respond_to?(:collections)
|
10
10
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_helper'))
|
6
6
|
|
7
|
-
class NewRelic::Agent::MetricStatsTest <
|
7
|
+
class NewRelic::Agent::MetricStatsTest < Minitest::Test
|
8
8
|
def setup
|
9
9
|
NewRelic::Agent.manual_start
|
10
10
|
@engine = NewRelic::Agent.instance.stats_engine
|
@@ -5,7 +5,7 @@
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..', '..','..','test_helper'))
|
6
6
|
require 'new_relic/agent/samplers/cpu_sampler'
|
7
7
|
|
8
|
-
class NewRelic::Agent::StatsEngine::SamplersTest <
|
8
|
+
class NewRelic::Agent::StatsEngine::SamplersTest < Minitest::Test
|
9
9
|
|
10
10
|
class OurSamplers
|
11
11
|
include NewRelic::Agent::StatsEngine::Samplers
|
@@ -5,7 +5,7 @@
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','..', 'test_helper'))
|
6
6
|
require File.expand_path(File.join(File.dirname(__FILE__),'..','data_container_tests'))
|
7
7
|
|
8
|
-
class NewRelic::Agent::StatsEngineTest <
|
8
|
+
class NewRelic::Agent::StatsEngineTest < Minitest::Test
|
9
9
|
def setup
|
10
10
|
NewRelic::Agent.manual_start
|
11
11
|
@engine = NewRelic::Agent::StatsEngine.new
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..', '..','test_helper'))
|
6
6
|
|
7
|
-
class NewRelic::Agent::StatsHashTest <
|
7
|
+
class NewRelic::Agent::StatsHashTest < Minitest::Test
|
8
8
|
def setup
|
9
9
|
@hash = NewRelic::Agent::StatsHash.new
|
10
10
|
NewRelic::Agent.instance.error_collector.errors.clear
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__),'..', '..', 'test_helper'))
|
6
6
|
|
7
|
-
class NewRelic::Agent::StatsTest <
|
7
|
+
class NewRelic::Agent::StatsTest < Minitest::Test
|
8
8
|
def mock_plusequals(first, second, method, first_value, second_value)
|
9
9
|
first.expects(method).returns(first_value)
|
10
10
|
second.expects(method).returns(second_value)
|
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_h
|
|
6
6
|
require 'new_relic/agent/threading/agent_thread'
|
7
7
|
|
8
8
|
module NewRelic::Agent::Threading
|
9
|
-
class AgentThreadTest <
|
9
|
+
class AgentThreadTest < Minitest::Test
|
10
10
|
|
11
11
|
def test_sets_label
|
12
12
|
t = AgentThread.new("labelled") {}
|
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),'..','..','..','test_h
|
|
6
6
|
require 'new_relic/agent/threading/backtrace_node'
|
7
7
|
|
8
8
|
module NewRelic::Agent::Threading
|
9
|
-
class BacktraceNodeTest <
|
9
|
+
class BacktraceNodeTest < Minitest::Test
|
10
10
|
SINGLE_LINE = "irb.rb:69:in `catch'"
|
11
11
|
|
12
12
|
def setup
|
@@ -10,7 +10,7 @@ require 'new_relic/agent/threading/threaded_test_case'
|
|
10
10
|
if NewRelic::Agent::Threading::BacktraceService.is_supported?
|
11
11
|
|
12
12
|
module NewRelic::Agent::Threading
|
13
|
-
class BacktraceServiceTest <
|
13
|
+
class BacktraceServiceTest < Minitest::Test
|
14
14
|
include ThreadedTestCase
|
15
15
|
|
16
16
|
def setup
|
@@ -504,7 +504,7 @@ if NewRelic::Agent::Threading::BacktraceService.is_supported?
|
|
504
504
|
|
505
505
|
# These tests do not use ThreadedTestCase as FakeThread is synchronous and
|
506
506
|
# prevents the detection of concurrency issues.
|
507
|
-
class BacktraceServiceConcurrencyTest <
|
507
|
+
class BacktraceServiceConcurrencyTest < Minitest::Test
|
508
508
|
def setup
|
509
509
|
NewRelic::Agent.instance.stats_engine.clear_stats
|
510
510
|
@service = BacktraceService.new
|
@@ -535,7 +535,7 @@ if NewRelic::Agent::Threading::BacktraceService.is_supported?
|
|
535
535
|
end
|
536
536
|
else
|
537
537
|
module NewRelic::Agent::Threading
|
538
|
-
class BacktraceServiceUnsupportedTest <
|
538
|
+
class BacktraceServiceUnsupportedTest < Minitest::Test
|
539
539
|
def test_is_not_supported?
|
540
540
|
assert_false BacktraceService.is_supported?
|
541
541
|
end
|
@@ -11,7 +11,7 @@ require 'new_relic/agent/threading/threaded_test_case'
|
|
11
11
|
if NewRelic::Agent::Threading::BacktraceService.is_supported?
|
12
12
|
|
13
13
|
module NewRelic::Agent::Threading
|
14
|
-
class ThreadProfileTest <
|
14
|
+
class ThreadProfileTest < Minitest::Test
|
15
15
|
include ThreadedTestCase
|
16
16
|
|
17
17
|
def setup
|