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
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# This file is distributed under New Relic's license terms.
|
3
|
+
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
|
+
|
5
|
+
require 'thread'
|
6
|
+
|
7
|
+
module NewRelic
|
8
|
+
module Agent
|
9
|
+
module VM
|
10
|
+
class RubiniusVM
|
11
|
+
def snapshot
|
12
|
+
snap = Snapshot.new
|
13
|
+
gather_stats(snap)
|
14
|
+
snap
|
15
|
+
end
|
16
|
+
|
17
|
+
def gather_stats(snap)
|
18
|
+
snap.gc_runs = GC.count
|
19
|
+
|
20
|
+
gc_stats = GC.stat[:gc]
|
21
|
+
snap.major_gc_count = gc_stats[:full][:count] if gc_stats[:full]
|
22
|
+
snap.minor_gc_count = gc_stats[:young][:count] if gc_stats[:young]
|
23
|
+
|
24
|
+
snap.thread_count = Thread.list.size
|
25
|
+
end
|
26
|
+
|
27
|
+
SUPPORTED_KEYS = [
|
28
|
+
:gc_runs,
|
29
|
+
:major_gc_count,
|
30
|
+
:minor_gc_count,
|
31
|
+
:thread_count
|
32
|
+
].freeze
|
33
|
+
|
34
|
+
def supports?(key)
|
35
|
+
SUPPORTED_KEYS.include?(key)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# This file is distributed under New Relic's license terms.
|
3
|
+
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
|
+
|
5
|
+
module NewRelic
|
6
|
+
module Agent
|
7
|
+
module VM
|
8
|
+
class Snapshot
|
9
|
+
attr_accessor :gc_total_time, :gc_runs, :major_gc_count, :minor_gc_count,
|
10
|
+
:total_allocated_object, :heap_live, :heap_free,
|
11
|
+
:method_cache_invalidations, :constant_cache_invalidations,
|
12
|
+
:thread_count
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/new_relic/control.rb
CHANGED
@@ -16,7 +16,6 @@ require 'socket'
|
|
16
16
|
require 'net/https'
|
17
17
|
require 'logger'
|
18
18
|
require 'new_relic/control/frameworks'
|
19
|
-
require 'new_relic/control/profiling'
|
20
19
|
require 'new_relic/control/server_methods'
|
21
20
|
require 'new_relic/control/instrumentation'
|
22
21
|
require 'new_relic/control/class_methods'
|
@@ -25,7 +24,6 @@ require 'new_relic/control/instance_methods'
|
|
25
24
|
require 'new_relic/agent'
|
26
25
|
require 'new_relic/delayed_job_injection'
|
27
26
|
|
28
|
-
|
29
27
|
module NewRelic
|
30
28
|
|
31
29
|
# The Control is a singleton responsible for the startup and
|
@@ -39,12 +37,8 @@ module NewRelic
|
|
39
37
|
# done in a subfile for load order purposes
|
40
38
|
# extend ClassMethods
|
41
39
|
# include InstanceMethods
|
42
|
-
# include Profiling
|
43
40
|
# include Configuration
|
44
41
|
# include ServerMethods
|
45
42
|
# include Instrumentation
|
46
|
-
|
47
|
-
|
48
|
-
|
49
43
|
end
|
50
44
|
end
|
@@ -64,6 +64,22 @@ module NewRelic::LanguageSupport
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
def gc_profiler_usable?
|
68
|
+
if defined?(::GC::Profiler) && !jruby?
|
69
|
+
true
|
70
|
+
else
|
71
|
+
false
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def gc_profiler_enabled?
|
76
|
+
if gc_profiler_usable? && ::GC::Profiler.enabled?
|
77
|
+
true
|
78
|
+
else
|
79
|
+
false
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
67
83
|
def object_space_usable?
|
68
84
|
if defined?(::JRuby) && JRuby.respond_to?(:runtime)
|
69
85
|
JRuby.runtime.is_object_space_enabled
|
@@ -74,6 +90,10 @@ module NewRelic::LanguageSupport
|
|
74
90
|
end
|
75
91
|
end
|
76
92
|
|
93
|
+
def jruby?
|
94
|
+
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
|
95
|
+
end
|
96
|
+
|
77
97
|
def rubinius?
|
78
98
|
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
|
79
99
|
end
|
@@ -1,35 +1,64 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
1
|
# encoding: utf-8
|
3
2
|
# This file is distributed under New Relic's license terms.
|
4
3
|
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
5
4
|
|
6
|
-
|
7
5
|
module NewRelic
|
8
6
|
module LatestChanges
|
9
7
|
def self.default_changelog
|
10
8
|
File.join(File.dirname(__FILE__), '..', '..', 'CHANGELOG')
|
11
9
|
end
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
changes.
|
11
|
+
FOOTER = <<'EOS'
|
12
|
+
See https://github.com/newrelic/rpm/blob/master/CHANGELOG for a full list of
|
13
|
+
changes.
|
17
14
|
EOS
|
18
15
|
|
19
|
-
|
16
|
+
def self.read(changelog=default_changelog)
|
17
|
+
changes = extract_latest_changes(File.read(changelog))
|
18
|
+
changes << FOOTER
|
20
19
|
|
21
|
-
|
20
|
+
changes.join("\n")
|
21
|
+
end
|
22
|
+
|
23
|
+
# Patches are expected to have the format of our normal item, with the
|
24
|
+
# precise version number included in the line in parens. For example:
|
25
|
+
#
|
26
|
+
# * This is a patch item (3.7.1.188)
|
27
|
+
def self.read_patch(patch_level, changelog=default_changelog)
|
28
|
+
latest = extract_latest_changes(File.read(changelog))
|
29
|
+
changes = ["## v#{patch_level} ##", ""]
|
30
|
+
|
31
|
+
current_item = nil
|
32
|
+
latest.each do |line|
|
33
|
+
if line.match /^\s*\*.*/
|
34
|
+
if line.match /\(#{patch_level}\)/
|
35
|
+
# Found a patch level item, so start tracking the lines!
|
36
|
+
current_item = line
|
37
|
+
else
|
38
|
+
# Found an item that isn't our patch level, so don't grab it
|
39
|
+
current_item = nil
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
if current_item
|
44
|
+
changes << line
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
changes.join("\n")
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.extract_latest_changes(contents)
|
22
52
|
changes = []
|
23
|
-
|
53
|
+
version_count = 0
|
54
|
+
contents.each_line do |line|
|
24
55
|
if line.match(/##\s+v[\d.]+\s+##/)
|
25
56
|
version_count += 1
|
26
57
|
end
|
27
58
|
break if version_count >= 2
|
28
59
|
changes << line.sub(/^ \* /, "* ").chomp
|
29
60
|
end
|
30
|
-
|
31
|
-
changes << footer
|
32
|
-
change_message = changes.join("\n")
|
61
|
+
changes
|
33
62
|
end
|
34
63
|
end
|
35
64
|
end
|
@@ -121,8 +121,15 @@ module NewRelic
|
|
121
121
|
render(:explain_sql)
|
122
122
|
end
|
123
123
|
|
124
|
+
PROFILE_CONFIG = { :'profiling.enabled' => true }
|
125
|
+
|
124
126
|
def profile
|
125
|
-
|
127
|
+
if params['start'] == 'true'
|
128
|
+
NewRelic::Agent.config.apply_config(PROFILE_CONFIG) unless NewRelic::Agent.config[:'profiling.enabled']
|
129
|
+
else
|
130
|
+
NewRelic::Agent.config.remove_config(PROFILE_CONFIG) if NewRelic::Agent.config[:'profiling.enabled']
|
131
|
+
end
|
132
|
+
|
126
133
|
index
|
127
134
|
end
|
128
135
|
|
@@ -31,9 +31,6 @@ module NewRelic
|
|
31
31
|
@segment_count = -1
|
32
32
|
@root_segment = create_segment 0.0, "ROOT"
|
33
33
|
@prepared = false
|
34
|
-
|
35
|
-
@guid = generate_guid
|
36
|
-
NewRelic::Agent::TransactionState.get.request_guid = @guid
|
37
34
|
end
|
38
35
|
|
39
36
|
def prepared?
|
@@ -209,16 +206,6 @@ module NewRelic
|
|
209
206
|
|
210
207
|
private
|
211
208
|
|
212
|
-
HEX_DIGITS = (0..15).map{|i| i.to_s(16)}
|
213
|
-
# generate a random 64 bit uuid
|
214
|
-
def generate_guid
|
215
|
-
guid = ''
|
216
|
-
HEX_DIGITS.each do |a|
|
217
|
-
guid << HEX_DIGITS[rand(16)]
|
218
|
-
end
|
219
|
-
guid
|
220
|
-
end
|
221
|
-
|
222
209
|
# This is badly in need of refactoring
|
223
210
|
def build_segment_with_omissions(new_sample, time_delta, source_segment, target_segment, regex)
|
224
211
|
source_segment.called_segments.each do |source_called_segment|
|
data/lib/new_relic/version.rb
CHANGED
data/lib/tasks/install.rake
CHANGED
@@ -4,6 +4,11 @@ namespace :newrelic do
|
|
4
4
|
load File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "install.rb"))
|
5
5
|
end
|
6
6
|
|
7
|
+
desc "Gratefulness is always appreciated"
|
8
|
+
task :thanks do
|
9
|
+
puts "The Ruby agent team is grateful to Jim Weirich for his kindness and his code. He will be missed."
|
10
|
+
end
|
11
|
+
|
7
12
|
namespace :config do
|
8
13
|
desc "Describe available New Relic configuration settings."
|
9
14
|
|
data/newrelic_rpm.gemspec
CHANGED
@@ -9,8 +9,9 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.name = "newrelic_rpm"
|
10
10
|
s.version = NewRelic::VERSION::STRING
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.authors = [ "Jason Clark", "Sam Goldstein", "Jonan Scheffler", "Ben Weintraub" ]
|
12
|
+
s.authors = [ "Jason Clark", "Sam Goldstein", "Jonan Scheffler", "Ben Weintraub", "Chris Pine" ]
|
13
13
|
s.date = Time.now.strftime('%Y-%m-%d')
|
14
|
+
s.licenses = ['New Relic', 'MIT', 'Ruby']
|
14
15
|
s.description = <<-EOS
|
15
16
|
New Relic is a performance management system, developed by New Relic,
|
16
17
|
Inc (http://www.newrelic.com). New Relic provides you with deep
|
@@ -19,9 +19,12 @@ module ActiveRecordFixtures
|
|
19
19
|
rescue => e
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
22
23
|
class Order < ActiveRecord::Base
|
23
24
|
self.table_name = 'newrelic_test_orders'
|
24
|
-
has_and_belongs_to_many :shipments, :class_name => 'ActiveRecordFixtures::Shipment'
|
25
|
+
has_and_belongs_to_many :shipments, :class_name => 'ActiveRecordFixtures::Shipment',
|
26
|
+
:join_table => 'orders_shipments'
|
27
|
+
|
25
28
|
def self.setup
|
26
29
|
unless check_for_table
|
27
30
|
connection.create_table self.table_name, :force => true do |t|
|
@@ -38,13 +41,6 @@ module ActiveRecordFixtures
|
|
38
41
|
false
|
39
42
|
end
|
40
43
|
|
41
|
-
def self.add_delay
|
42
|
-
# Introduce a 5 ms delay into db operations on Orders
|
43
|
-
def connection.log_info *args
|
44
|
-
sleep 0.005
|
45
|
-
super *args
|
46
|
-
end
|
47
|
-
end
|
48
44
|
def self.teardown
|
49
45
|
def connection.log_info *args
|
50
46
|
super *args
|
@@ -54,7 +50,9 @@ module ActiveRecordFixtures
|
|
54
50
|
|
55
51
|
class Shipment < ActiveRecord::Base
|
56
52
|
self.table_name = 'newrelic_test_shipment'
|
57
|
-
has_and_belongs_to_many :orders, :class_name => 'ActiveRecordFixtures::Order'
|
53
|
+
has_and_belongs_to_many :orders, :class_name => 'ActiveRecordFixtures::Order',
|
54
|
+
:join_table => 'orders_shipments'
|
55
|
+
|
58
56
|
def self.setup
|
59
57
|
unless check_for_table
|
60
58
|
connection.create_table self.table_name, :force => true do |t|
|
data/test/agent_helper.rb
CHANGED
@@ -13,56 +13,6 @@ def assert_in_delta(expected, actual, delta)
|
|
13
13
|
assert_between((expected - delta), (expected + delta), actual)
|
14
14
|
end
|
15
15
|
|
16
|
-
def check_metric_time(metric, value, delta)
|
17
|
-
time = NewRelic::Agent.get_stats(metric).total_call_time
|
18
|
-
assert_in_delta(value, time, delta)
|
19
|
-
end
|
20
|
-
|
21
|
-
def check_metric_count(metric, value)
|
22
|
-
count = NewRelic::Agent.get_stats(metric).call_count
|
23
|
-
assert_equal(value, count, "should have the correct number of calls")
|
24
|
-
end
|
25
|
-
|
26
|
-
def check_unscoped_metric_count(metric, value)
|
27
|
-
count = NewRelic::Agent.get_stats_unscoped(metric).call_count
|
28
|
-
assert_equal(value, count, "should have the correct number of calls")
|
29
|
-
end
|
30
|
-
|
31
|
-
def generate_unscoped_metric_counts(*metrics)
|
32
|
-
metrics.inject({}) do |sum, metric|
|
33
|
-
sum[metric] = NewRelic::Agent.get_stats_no_scope(metric).call_count
|
34
|
-
sum
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def generate_metric_counts(*metrics)
|
39
|
-
metrics.inject({}) do |sum, metric|
|
40
|
-
sum[metric] = NewRelic::Agent.get_stats(metric).call_count
|
41
|
-
sum
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def assert_does_not_call_metrics(*metrics)
|
46
|
-
first_metrics = generate_metric_counts(*metrics)
|
47
|
-
yield
|
48
|
-
last_metrics = generate_metric_counts(*metrics)
|
49
|
-
assert_equal first_metrics, last_metrics, "should not have changed these metrics"
|
50
|
-
end
|
51
|
-
|
52
|
-
def assert_calls_metrics(*metrics)
|
53
|
-
first_metrics = generate_metric_counts(*metrics)
|
54
|
-
yield
|
55
|
-
last_metrics = generate_metric_counts(*metrics)
|
56
|
-
refute_equal first_metrics, last_metrics, "should have changed these metrics"
|
57
|
-
end
|
58
|
-
|
59
|
-
def assert_calls_unscoped_metrics(*metrics)
|
60
|
-
first_metrics = generate_unscoped_metric_counts(*metrics)
|
61
|
-
yield
|
62
|
-
last_metrics = generate_unscoped_metric_counts(*metrics)
|
63
|
-
refute_equal first_metrics, last_metrics, "should have changed these metrics"
|
64
|
-
end
|
65
|
-
|
66
16
|
def assert_has_error(error_class)
|
67
17
|
assert \
|
68
18
|
NewRelic::Agent.instance.error_collector.errors.find {|e| e.exception_class_constant == error_class} != nil, \
|
@@ -264,6 +214,17 @@ def find_last_transaction_segment(transaction_sample=nil)
|
|
264
214
|
return last_segment
|
265
215
|
end
|
266
216
|
|
217
|
+
def find_segment_by_name(transaction_sample, name)
|
218
|
+
first_segment = nil
|
219
|
+
transaction_sample.root_segment.each_segment do |s|
|
220
|
+
if s.metric_name == name
|
221
|
+
first_segment = s
|
222
|
+
break
|
223
|
+
end
|
224
|
+
end
|
225
|
+
first_segment
|
226
|
+
end
|
227
|
+
|
267
228
|
def with_config(config_hash, opts={})
|
268
229
|
opts = { :level => 0, :do_not_cast => false }.merge(opts)
|
269
230
|
if opts[:do_not_cast]
|
@@ -11,15 +11,13 @@ module Environments
|
|
11
11
|
include Multiverse::Color
|
12
12
|
|
13
13
|
BLACKLIST = {
|
14
|
-
"1.8.
|
15
|
-
"
|
16
|
-
"ree" => ["rails40"],
|
17
|
-
"1.9.1" => ["rails21", "rails22", "rails30", "rails31", "rails32", "rails40", "norails"],
|
14
|
+
"1.8.7" => ["rails40", "rails41"],
|
15
|
+
"ree" => ["rails40", "rails41"],
|
18
16
|
"1.9.2" => ["rails21", "rails22", "rails40"],
|
19
17
|
"1.9.3" => ["rails21", "rails22"],
|
20
18
|
"2.0.0" => ["rails21", "rails22", "rails23"],
|
21
19
|
"2.1.0" => ["rails21", "rails22", "rails23"],
|
22
|
-
"jruby-1.6" => ["rails40"],
|
20
|
+
"jruby-1.6" => ["rails40", "rails41"],
|
23
21
|
"jruby-1.7" => ["rails21", "rails22", "rails23"],
|
24
22
|
"rbx-2.0" => ["rails21", "rails22", "rails23", "rails30", "rails31", "rails32"],
|
25
23
|
}
|
@@ -4,7 +4,15 @@ gem 'rake'
|
|
4
4
|
|
5
5
|
gem 'rails', '~>4.0.1'
|
6
6
|
|
7
|
-
|
7
|
+
# Do not automatically require minitest, since this will break with rbx-2.2.5.
|
8
|
+
# rbx-2.2.5 helpfully bundles minitest-5.3.0.
|
9
|
+
# Our tests don't work with minitest-5.3.0.
|
10
|
+
# minitest-4.7.5 is the version we want to use here, but if you just do
|
11
|
+
# a require 'minitest' on rbx-2.2.5, you'll get 5.3.0 (since 4.7.5 doesn't
|
12
|
+
# actually have a minitest.rb file under lib/). The :require => false prevents
|
13
|
+
# us from inadvertently loading minitest 5.3.0 on rbx (we'll require
|
14
|
+
# minitest/unit instead via a different path).
|
15
|
+
gem 'minitest', '~>4.7.5', :require => false
|
8
16
|
gem 'mocha', :require => false
|
9
17
|
gem 'rack'
|
10
18
|
gem 'rack-test'
|
@@ -17,8 +25,9 @@ end
|
|
17
25
|
|
18
26
|
platforms :ruby do
|
19
27
|
gem "mysql"
|
20
|
-
|
21
|
-
|
28
|
+
# Lock at 1.3.8 to work around:
|
29
|
+
# https://github.com/sparklemotion/sqlite3-ruby/issues/122
|
30
|
+
gem "sqlite3", '1.3.8'
|
22
31
|
end
|
23
32
|
|
24
33
|
platforms :rbx do
|