newrelic_rpm 4.1.0.333 → 4.2.0.334

Sign up to get free protection for your applications and to get access to all the features.
Files changed (788) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +30 -25
  3. data/CHANGELOG.md +19 -0
  4. data/lib/new_relic/agent/database.rb +9 -3
  5. data/lib/new_relic/agent/datastores.rb +8 -7
  6. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +3 -4
  7. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +26 -4
  8. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +4 -2
  9. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +3 -5
  10. data/lib/new_relic/agent/instrumentation/data_mapper.rb +5 -2
  11. data/lib/new_relic/agent/instrumentation/mongo.rb +5 -5
  12. data/lib/new_relic/agent/instrumentation/rake.rb +3 -1
  13. data/lib/new_relic/agent/method_tracer_helpers.rb +0 -57
  14. data/lib/new_relic/agent/supported_versions.rb +6 -5
  15. data/lib/new_relic/agent/transaction.rb +58 -67
  16. data/lib/new_relic/agent/transaction/abstract_segment.rb +33 -4
  17. data/lib/new_relic/agent/transaction/datastore_segment.rb +22 -21
  18. data/lib/new_relic/agent/transaction/external_request_segment.rb +4 -3
  19. data/lib/new_relic/agent/transaction/segment.rb +27 -1
  20. data/lib/new_relic/agent/transaction/tracing.rb +18 -4
  21. data/lib/new_relic/agent/transaction_sampler.rb +0 -105
  22. data/lib/new_relic/agent/transaction_state.rb +0 -8
  23. data/lib/new_relic/control/frameworks/ruby.rb +2 -2
  24. data/lib/new_relic/version.rb +1 -1
  25. data/lib/sequel/extensions/newrelic_instrumentation.rb +21 -9
  26. data/newrelic_rpm.gemspec +2 -2
  27. metadata +3 -764
  28. data/lib/new_relic/agent/traced_method_stack.rb +0 -109
  29. data/test/agent_helper.rb +0 -672
  30. data/test/config/newrelic.yml +0 -46
  31. data/test/config/test.cert.crt +0 -18
  32. data/test/config/test.cert.key +0 -15
  33. data/test/config/test_control.rb +0 -54
  34. data/test/environments/.gitignore +0 -16
  35. data/test/environments/lib/environments/runner.rb +0 -111
  36. data/test/environments/norails/Gemfile +0 -19
  37. data/test/environments/norails/Rakefile +0 -9
  38. data/test/environments/rails21/Gemfile +0 -23
  39. data/test/environments/rails21/Rakefile +0 -16
  40. data/test/environments/rails21/app/controllers/application.rb +0 -20
  41. data/test/environments/rails21/config/boot.rb +0 -113
  42. data/test/environments/rails21/config/database.yml +0 -26
  43. data/test/environments/rails21/config/environment.rb +0 -26
  44. data/test/environments/rails21/config/environments/development.rb +0 -10
  45. data/test/environments/rails21/config/environments/production.rb +0 -8
  46. data/test/environments/rails21/config/environments/test.rb +0 -10
  47. data/test/environments/rails21/config/routes.rb +0 -5
  48. data/test/environments/rails21/db/schema.rb +0 -5
  49. data/test/environments/rails22/Gemfile +0 -24
  50. data/test/environments/rails22/Rakefile +0 -16
  51. data/test/environments/rails22/app/controllers/application.rb +0 -20
  52. data/test/environments/rails22/config/boot.rb +0 -113
  53. data/test/environments/rails22/config/database.yml +0 -26
  54. data/test/environments/rails22/config/environment.rb +0 -25
  55. data/test/environments/rails22/config/environments/development.rb +0 -10
  56. data/test/environments/rails22/config/environments/production.rb +0 -8
  57. data/test/environments/rails22/config/environments/test.rb +0 -10
  58. data/test/environments/rails22/config/routes.rb +0 -5
  59. data/test/environments/rails22/db/schema.rb +0 -5
  60. data/test/environments/rails23/Gemfile +0 -24
  61. data/test/environments/rails23/Rakefile +0 -16
  62. data/test/environments/rails23/app/controllers/application.rb +0 -20
  63. data/test/environments/rails23/config/boot.rb +0 -127
  64. data/test/environments/rails23/config/database.yml +0 -26
  65. data/test/environments/rails23/config/environment.rb +0 -16
  66. data/test/environments/rails23/config/environments/production.rb +0 -8
  67. data/test/environments/rails23/config/environments/test.rb +0 -10
  68. data/test/environments/rails23/config/preinitializer.rb +0 -25
  69. data/test/environments/rails23/config/routes.rb +0 -5
  70. data/test/environments/rails23/db/schema.rb +0 -5
  71. data/test/environments/rails30/Gemfile +0 -23
  72. data/test/environments/rails30/Rakefile +0 -11
  73. data/test/environments/rails30/config/application.rb +0 -17
  74. data/test/environments/rails30/config/boot.rb +0 -10
  75. data/test/environments/rails30/config/database.yml +0 -26
  76. data/test/environments/rails30/config/environment.rb +0 -6
  77. data/test/environments/rails30/config/initializers/new_rails_defaults.rb +0 -11
  78. data/test/environments/rails30/db/schema.rb +0 -5
  79. data/test/environments/rails31/Gemfile +0 -24
  80. data/test/environments/rails31/Rakefile +0 -11
  81. data/test/environments/rails31/config/application.rb +0 -18
  82. data/test/environments/rails31/config/boot.rb +0 -10
  83. data/test/environments/rails31/config/database.yml +0 -26
  84. data/test/environments/rails31/config/environment.rb +0 -6
  85. data/test/environments/rails31/config/initializers/new_rails_defaults.rb +0 -21
  86. data/test/environments/rails31/db/schema.rb +0 -5
  87. data/test/environments/rails32/Gemfile +0 -26
  88. data/test/environments/rails32/Rakefile +0 -12
  89. data/test/environments/rails32/config/application.rb +0 -19
  90. data/test/environments/rails32/config/boot.rb +0 -10
  91. data/test/environments/rails32/config/database.yml +0 -26
  92. data/test/environments/rails32/config/environment.rb +0 -6
  93. data/test/environments/rails32/db/schema.rb +0 -5
  94. data/test/environments/rails40/Gemfile +0 -26
  95. data/test/environments/rails40/Rakefile +0 -11
  96. data/test/environments/rails40/config/application.rb +0 -18
  97. data/test/environments/rails40/config/boot.rb +0 -10
  98. data/test/environments/rails40/config/database.yml +0 -26
  99. data/test/environments/rails40/config/environment.rb +0 -6
  100. data/test/environments/rails40/db/schema.rb +0 -5
  101. data/test/environments/rails41/Gemfile +0 -26
  102. data/test/environments/rails41/Rakefile +0 -11
  103. data/test/environments/rails41/config/application.rb +0 -18
  104. data/test/environments/rails41/config/boot.rb +0 -10
  105. data/test/environments/rails41/config/database.yml +0 -26
  106. data/test/environments/rails41/config/environment.rb +0 -6
  107. data/test/environments/rails41/db/schema.rb +0 -5
  108. data/test/environments/rails42/Gemfile +0 -27
  109. data/test/environments/rails42/Rakefile +0 -11
  110. data/test/environments/rails42/config/application.rb +0 -18
  111. data/test/environments/rails42/config/boot.rb +0 -10
  112. data/test/environments/rails42/config/database.yml +0 -26
  113. data/test/environments/rails42/config/environment.rb +0 -6
  114. data/test/environments/rails42/db/schema.rb +0 -5
  115. data/test/environments/rails50/Gemfile +0 -23
  116. data/test/environments/rails50/Rakefile +0 -11
  117. data/test/environments/rails50/config/application.rb +0 -18
  118. data/test/environments/rails50/config/boot.rb +0 -10
  119. data/test/environments/rails50/config/database.yml +0 -26
  120. data/test/environments/rails50/config/environment.rb +0 -6
  121. data/test/environments/rails50/db/schema.rb +0 -5
  122. data/test/fixtures/cross_agent_tests/README.md +0 -34
  123. data/test/fixtures/cross_agent_tests/attribute_configuration.json +0 -384
  124. data/test/fixtures/cross_agent_tests/aws.json +0 -312
  125. data/test/fixtures/cross_agent_tests/cat/README.md +0 -28
  126. data/test/fixtures/cross_agent_tests/cat/cat_map.json +0 -595
  127. data/test/fixtures/cross_agent_tests/cat/path_hashing.json +0 -51
  128. data/test/fixtures/cross_agent_tests/cat_map.json +0 -597
  129. data/test/fixtures/cross_agent_tests/data_transport/data_transport.json +0 -1441
  130. data/test/fixtures/cross_agent_tests/data_transport/data_transport.md +0 -35
  131. data/test/fixtures/cross_agent_tests/datastores/README.md +0 -16
  132. data/test/fixtures/cross_agent_tests/datastores/datastore_api.json +0 -443
  133. data/test/fixtures/cross_agent_tests/datastores/datastore_instances.json +0 -73
  134. data/test/fixtures/cross_agent_tests/docker_container_id/README.md +0 -6
  135. data/test/fixtures/cross_agent_tests/docker_container_id/cases.json +0 -75
  136. data/test/fixtures/cross_agent_tests/docker_container_id/docker-0.9.1.txt +0 -10
  137. data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.0.0.txt +0 -10
  138. data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.1.2-lxc-driver.txt +0 -10
  139. data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.1.2-native-driver-fs.txt +0 -10
  140. data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.1.2-native-driver-systemd.txt +0 -10
  141. data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.3.txt +0 -9
  142. data/test/fixtures/cross_agent_tests/docker_container_id/empty.txt +0 -0
  143. data/test/fixtures/cross_agent_tests/docker_container_id/heroku.txt +0 -1
  144. data/test/fixtures/cross_agent_tests/docker_container_id/invalid-characters.txt +0 -9
  145. data/test/fixtures/cross_agent_tests/docker_container_id/invalid-length.txt +0 -9
  146. data/test/fixtures/cross_agent_tests/docker_container_id/ubuntu-14.04-lxc-container.txt +0 -10
  147. data/test/fixtures/cross_agent_tests/docker_container_id/ubuntu-14.04-no-container.txt +0 -10
  148. data/test/fixtures/cross_agent_tests/docker_container_id/ubuntu-14.10-no-container.txt +0 -10
  149. data/test/fixtures/cross_agent_tests/labels.json +0 -195
  150. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/README.md +0 -16
  151. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.colon_obfuscated.txt +0 -3
  152. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.explain.txt +0 -3
  153. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.obfuscated.txt +0 -3
  154. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.query.txt +0 -1
  155. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/current_date.colon_obfuscated.txt +0 -2
  156. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/current_date.explain.txt +0 -2
  157. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/current_date.obfuscated.txt +0 -2
  158. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/current_date.query.txt +0 -1
  159. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/date.colon_obfuscated.txt +0 -2
  160. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/date.explain.txt +0 -2
  161. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/date.obfuscated.txt +0 -2
  162. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/date.query.txt +0 -1
  163. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_newline.colon_obfuscated.txt +0 -2
  164. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_newline.explain.txt +0 -3
  165. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_newline.obfuscated.txt +0 -2
  166. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_newline.query.txt +0 -1
  167. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_quote.colon_obfuscated.txt +0 -2
  168. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_quote.explain.txt +0 -2
  169. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_quote.obfuscated.txt +0 -2
  170. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/embedded_quote.query.txt +0 -1
  171. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/floating_point.colon_obfuscated.txt +0 -2
  172. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/floating_point.explain.txt +0 -2
  173. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/floating_point.obfuscated.txt +0 -2
  174. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/floating_point.query.txt +0 -1
  175. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/function_with_strings.colon_obfuscated.txt +0 -5
  176. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/function_with_strings.explain.txt +0 -5
  177. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/function_with_strings.obfuscated.txt +0 -5
  178. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/function_with_strings.query.txt +0 -1
  179. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/quote_in_table_name.colon_obfuscated.txt +0 -2
  180. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/quote_in_table_name.explain.txt +0 -2
  181. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/quote_in_table_name.obfuscated.txt +0 -2
  182. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/quote_in_table_name.query.txt +0 -1
  183. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/subplan.colon_obfuscated.txt +0 -5
  184. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/subplan.explain.txt +0 -5
  185. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/subplan.obfuscated.txt +0 -5
  186. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/subplan.query.txt +0 -1
  187. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_integer.colon_obfuscated.txt +0 -2
  188. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_integer.explain.txt +0 -2
  189. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_integer.obfuscated.txt +0 -2
  190. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_integer.query.txt +0 -1
  191. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_regex_chars.colon_obfuscated.txt +0 -2
  192. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_regex_chars.explain.txt +0 -2
  193. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_regex_chars.obfuscated.txt +0 -2
  194. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_regex_chars.query.txt +0 -1
  195. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_substring.colon_obfuscated.txt +0 -3
  196. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_substring.explain.txt +0 -3
  197. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_substring.obfuscated.txt +0 -3
  198. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/where_with_substring.query.txt +0 -1
  199. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case1.colon_obfuscated.txt +0 -2
  200. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case1.explain.txt +0 -2
  201. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case1.obfuscated.txt +0 -2
  202. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case1.query.txt +0 -1
  203. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case2.colon_obfuscated.txt +0 -2
  204. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case2.explain.txt +0 -3
  205. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case2.obfuscated.txt +0 -2
  206. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case2.query.txt +0 -1
  207. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case3.colon_obfuscated.txt +0 -2
  208. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case3.explain.txt +0 -2
  209. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case3.obfuscated.txt +0 -2
  210. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case3.query.txt +0 -1
  211. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case4.colon_obfuscated.txt +0 -2
  212. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case4.explain.txt +0 -2
  213. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case4.obfuscated.txt +0 -2
  214. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case4.query.txt +0 -1
  215. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case5.colon_obfuscated.txt +0 -2
  216. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case5.explain.txt +0 -2
  217. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case5.obfuscated.txt +0 -2
  218. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case5.query.txt +0 -1
  219. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case6.colon_obfuscated.txt +0 -2
  220. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case6.explain.txt +0 -2
  221. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case6.obfuscated.txt +0 -2
  222. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case6.query.txt +0 -1
  223. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case7.colon_obfuscated.txt +0 -2
  224. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case7.explain.txt +0 -2
  225. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case7.obfuscated.txt +0 -2
  226. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case7.query.txt +0 -1
  227. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case8.colon_obfuscated.txt +0 -2
  228. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case8.explain.txt +0 -2
  229. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case8.obfuscated.txt +0 -2
  230. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case8.query.txt +0 -1
  231. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case9.colon_obfuscated.txt +0 -2
  232. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case9.explain.txt +0 -2
  233. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case9.obfuscated.txt +0 -2
  234. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/with_escape_case9.query.txt +0 -1
  235. data/test/fixtures/cross_agent_tests/proc_cpuinfo/1pack_1core_1logical.txt +0 -3
  236. data/test/fixtures/cross_agent_tests/proc_cpuinfo/1pack_1core_2logical.txt +0 -14
  237. data/test/fixtures/cross_agent_tests/proc_cpuinfo/1pack_2core_2logical.txt +0 -14
  238. data/test/fixtures/cross_agent_tests/proc_cpuinfo/1pack_4core_4logical.txt +0 -28
  239. data/test/fixtures/cross_agent_tests/proc_cpuinfo/2pack_12core_24logical.txt +0 -575
  240. data/test/fixtures/cross_agent_tests/proc_cpuinfo/2pack_20core_40logical.txt +0 -999
  241. data/test/fixtures/cross_agent_tests/proc_cpuinfo/2pack_2core_2logical.txt +0 -51
  242. data/test/fixtures/cross_agent_tests/proc_cpuinfo/2pack_2core_4logical.txt +0 -28
  243. data/test/fixtures/cross_agent_tests/proc_cpuinfo/2pack_4core_4logical.txt +0 -28
  244. data/test/fixtures/cross_agent_tests/proc_cpuinfo/4pack_4core_4logical.txt +0 -103
  245. data/test/fixtures/cross_agent_tests/proc_cpuinfo/8pack_8core_8logical.txt +0 -199
  246. data/test/fixtures/cross_agent_tests/proc_cpuinfo/README.md +0 -28
  247. data/test/fixtures/cross_agent_tests/proc_cpuinfo/Xpack_Xcore_2logical.txt +0 -43
  248. data/test/fixtures/cross_agent_tests/proc_cpuinfo/malformed_file.txt +0 -3
  249. data/test/fixtures/cross_agent_tests/proc_meminfo/README.md +0 -7
  250. data/test/fixtures/cross_agent_tests/proc_meminfo/meminfo_4096MB.txt +0 -47
  251. data/test/fixtures/cross_agent_tests/rules.json +0 -165
  252. data/test/fixtures/cross_agent_tests/rum_client_config.json +0 -91
  253. data/test/fixtures/cross_agent_tests/rum_footer_insertion_location/close-body-in-comment.html +0 -10
  254. data/test/fixtures/cross_agent_tests/rum_footer_insertion_location/dynamic-iframe.html +0 -19
  255. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/basic.html +0 -10
  256. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/body_with_attributes.html +0 -3
  257. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/charset_tag.html +0 -11
  258. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/charset_tag_after_x_ua_tag.html +0 -11
  259. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/charset_tag_before_x_ua_tag.html +0 -11
  260. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/charset_tag_with_spaces.html +0 -11
  261. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/comments1.html +0 -24
  262. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/comments2.html +0 -24
  263. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/content_type_charset_tag.html +0 -11
  264. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/content_type_charset_tag_after_x_ua_tag.html +0 -11
  265. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/content_type_charset_tag_before_x_ua_tag.html +0 -11
  266. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/empty_head +0 -4
  267. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_quotes1.html +0 -27
  268. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_quotes2.html +0 -24
  269. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_quotes_mismatch.html +0 -24
  270. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_single_quotes1.html +0 -25
  271. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/gt_in_single_quotes_mismatch.html +0 -25
  272. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/head_with_attributes.html +0 -10
  273. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/incomplete_non_meta_tags.html +0 -10
  274. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_end_header.html +0 -6
  275. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_header.html +0 -7
  276. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_html_and_no_header.html +0 -3
  277. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_start_header.html +0 -9
  278. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/script1.html +0 -19
  279. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/script2.html +0 -17
  280. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag.html +0 -10
  281. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_multiline.html +0 -11
  282. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_multiple_tags.html +0 -12
  283. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_spaces_around_equals.html +0 -10
  284. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_with_others.html +0 -11
  285. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_with_spaces.html +0 -10
  286. data/test/fixtures/cross_agent_tests/sql_obfuscation/README.md +0 -36
  287. data/test/fixtures/cross_agent_tests/sql_obfuscation/sql_obfuscation.json +0 -619
  288. data/test/fixtures/cross_agent_tests/sql_parsing.json +0 -55
  289. data/test/fixtures/cross_agent_tests/synthetics/README.md +0 -65
  290. data/test/fixtures/cross_agent_tests/synthetics/synthetics.json +0 -317
  291. data/test/fixtures/cross_agent_tests/transaction_segment_terms.json +0 -389
  292. data/test/fixtures/cross_agent_tests/url_clean.json +0 -15
  293. data/test/fixtures/cross_agent_tests/url_domain_extraction.json +0 -35
  294. data/test/fixtures/cross_agent_tests/utilization/README.md +0 -13
  295. data/test/fixtures/cross_agent_tests/utilization/utilization_json.json +0 -132
  296. data/test/helpers/exceptions.rb +0 -16
  297. data/test/helpers/file_searching.rb +0 -28
  298. data/test/helpers/logging.rb +0 -37
  299. data/test/helpers/minitest.rb +0 -50
  300. data/test/helpers/misc.rb +0 -87
  301. data/test/helpers/mongo_metric_builder.rb +0 -34
  302. data/test/helpers/transaction_sample.rb +0 -44
  303. data/test/intentional_fail.rb +0 -13
  304. data/test/multiverse/.gitignore +0 -13
  305. data/test/multiverse/README.md +0 -85
  306. data/test/multiverse/lib/multiverse.rb +0 -32
  307. data/test/multiverse/lib/multiverse/color.rb +0 -23
  308. data/test/multiverse/lib/multiverse/envfile.rb +0 -66
  309. data/test/multiverse/lib/multiverse/output_collector.rb +0 -82
  310. data/test/multiverse/lib/multiverse/runner.rb +0 -126
  311. data/test/multiverse/lib/multiverse/shell_utils.rb +0 -27
  312. data/test/multiverse/lib/multiverse/suite.rb +0 -536
  313. data/test/multiverse/script/runner +0 -5
  314. data/test/multiverse/suites/active_record/.gitignore +0 -1
  315. data/test/multiverse/suites/active_record/Envfile +0 -60
  316. data/test/multiverse/suites/active_record/Rakefile +0 -9
  317. data/test/multiverse/suites/active_record/active_record_test.rb +0 -618
  318. data/test/multiverse/suites/active_record/app/models/models.rb +0 -34
  319. data/test/multiverse/suites/active_record/ar_method_aliasing.rb +0 -43
  320. data/test/multiverse/suites/active_record/before_suite.rb +0 -23
  321. data/test/multiverse/suites/active_record/config/database.rb +0 -79
  322. data/test/multiverse/suites/active_record/config/database.yml +0 -20
  323. data/test/multiverse/suites/active_record/config/newrelic.yml +0 -17
  324. data/test/multiverse/suites/active_record/db/migrate/20141105131800_create_users_and_aliases.rb +0 -21
  325. data/test/multiverse/suites/active_record/db/migrate/20141106082200_create_orders_and_shipments.rb +0 -25
  326. data/test/multiverse/suites/active_record/db/migrate/20150413011200_add_timestamps_to_orders.rb +0 -16
  327. data/test/multiverse/suites/active_record/db/migrate/20150414084400_create_groups.rb +0 -21
  328. data/test/multiverse/suites/activemerchant/Envfile +0 -26
  329. data/test/multiverse/suites/activemerchant/activemerchant_test.rb +0 -62
  330. data/test/multiverse/suites/agent_only/Envfile +0 -5
  331. data/test/multiverse/suites/agent_only/agent_attributes_test.rb +0 -351
  332. data/test/multiverse/suites/agent_only/agent_run_id_handling_test.rb +0 -39
  333. data/test/multiverse/suites/agent_only/audit_log_test.rb +0 -57
  334. data/test/multiverse/suites/agent_only/collector_exception_handling_test.rb +0 -87
  335. data/test/multiverse/suites/agent_only/config/newrelic.yml +0 -26
  336. data/test/multiverse/suites/agent_only/cross_application_tracing_test.rb +0 -94
  337. data/test/multiverse/suites/agent_only/custom_analytics_events_test.rb +0 -82
  338. data/test/multiverse/suites/agent_only/custom_queue_time_test.rb +0 -60
  339. data/test/multiverse/suites/agent_only/encoding_handling_test.rb +0 -122
  340. data/test/multiverse/suites/agent_only/error_events_test.rb +0 -98
  341. data/test/multiverse/suites/agent_only/exclusive_time_test.rb +0 -176
  342. data/test/multiverse/suites/agent_only/harvest_timestamps_test.rb +0 -61
  343. data/test/multiverse/suites/agent_only/http_response_code_test.rb +0 -38
  344. data/test/multiverse/suites/agent_only/keepalive_test.rb +0 -24
  345. data/test/multiverse/suites/agent_only/key_transactions_test.rb +0 -118
  346. data/test/multiverse/suites/agent_only/labels_test.rb +0 -83
  347. data/test/multiverse/suites/agent_only/logging_test.rb +0 -162
  348. data/test/multiverse/suites/agent_only/marshaling_test.rb +0 -89
  349. data/test/multiverse/suites/agent_only/pipe_manager_test.rb +0 -41
  350. data/test/multiverse/suites/agent_only/rename_rule_test.rb +0 -91
  351. data/test/multiverse/suites/agent_only/rum_instrumentation_test.rb +0 -97
  352. data/test/multiverse/suites/agent_only/script/env_change.rb +0 -10
  353. data/test/multiverse/suites/agent_only/script/loading.rb +0 -20
  354. data/test/multiverse/suites/agent_only/script/public_api_when_disabled.rb +0 -57
  355. data/test/multiverse/suites/agent_only/script/symbol_env.rb +0 -10
  356. data/test/multiverse/suites/agent_only/script/warnings.rb +0 -15
  357. data/test/multiverse/suites/agent_only/service_timeout_test.rb +0 -39
  358. data/test/multiverse/suites/agent_only/set_transaction_name_test.rb +0 -118
  359. data/test/multiverse/suites/agent_only/ssl_test.rb +0 -21
  360. data/test/multiverse/suites/agent_only/start_up_test.rb +0 -107
  361. data/test/multiverse/suites/agent_only/synthetics_test.rb +0 -131
  362. data/test/multiverse/suites/agent_only/testing_app.rb +0 -58
  363. data/test/multiverse/suites/agent_only/thread_profiling_test.rb +0 -137
  364. data/test/multiverse/suites/agent_only/transaction_events_test.rb +0 -31
  365. data/test/multiverse/suites/agent_only/transaction_ignoring_test.rb +0 -42
  366. data/test/multiverse/suites/agent_only/utilization_data_collection_test.rb +0 -105
  367. data/test/multiverse/suites/agent_only/xray_sessions_test.rb +0 -196
  368. data/test/multiverse/suites/bare/Envfile +0 -3
  369. data/test/multiverse/suites/bare/standalone_instrumentation_test.rb +0 -43
  370. data/test/multiverse/suites/capistrano/Capfile +0 -26
  371. data/test/multiverse/suites/capistrano/Envfile +0 -23
  372. data/test/multiverse/suites/capistrano/config/deploy.rb +0 -14
  373. data/test/multiverse/suites/capistrano/config/deploy/production.rb +0 -9
  374. data/test/multiverse/suites/capistrano/config/newrelic.yml +0 -20
  375. data/test/multiverse/suites/capistrano/deployment_test.rb +0 -51
  376. data/test/multiverse/suites/capistrano2/Capfile +0 -4
  377. data/test/multiverse/suites/capistrano2/Envfile +0 -8
  378. data/test/multiverse/suites/capistrano2/config/deploy.rb +0 -19
  379. data/test/multiverse/suites/capistrano2/config/newrelic.yml +0 -20
  380. data/test/multiverse/suites/capistrano2/deployment_test.rb +0 -37
  381. data/test/multiverse/suites/config_file_loading/Envfile +0 -13
  382. data/test/multiverse/suites/config_file_loading/config_file_loading_test.rb +0 -213
  383. data/test/multiverse/suites/curb/Envfile +0 -27
  384. data/test/multiverse/suites/curb/config/newrelic.yml +0 -17
  385. data/test/multiverse/suites/curb/curb_test.rb +0 -212
  386. data/test/multiverse/suites/datamapper/Envfile +0 -36
  387. data/test/multiverse/suites/datamapper/config/newrelic.yml +0 -19
  388. data/test/multiverse/suites/datamapper/datamapper_test.rb +0 -429
  389. data/test/multiverse/suites/deferred_instrumentation/Envfile +0 -15
  390. data/test/multiverse/suites/deferred_instrumentation/config/newrelic.yml +0 -19
  391. data/test/multiverse/suites/deferred_instrumentation/sinatra_test.rb +0 -110
  392. data/test/multiverse/suites/delayed_job/Envfile +0 -101
  393. data/test/multiverse/suites/delayed_job/before_suite.rb +0 -43
  394. data/test/multiverse/suites/delayed_job/config/newrelic.yml +0 -17
  395. data/test/multiverse/suites/delayed_job/delayed_job_instrumentation_test.rb +0 -106
  396. data/test/multiverse/suites/delayed_job/delayed_job_sampler_test.rb +0 -128
  397. data/test/multiverse/suites/delayed_job/unsupported_backend_test.rb +0 -21
  398. data/test/multiverse/suites/excon/Envfile +0 -18
  399. data/test/multiverse/suites/excon/config/newrelic.yml +0 -17
  400. data/test/multiverse/suites/excon/excon_test.rb +0 -81
  401. data/test/multiverse/suites/grape/Envfile +0 -9
  402. data/test/multiverse/suites/grape/config/newrelic.yml +0 -18
  403. data/test/multiverse/suites/grape/grape_test.rb +0 -219
  404. data/test/multiverse/suites/grape/grape_test_api.rb +0 -64
  405. data/test/multiverse/suites/grape/grape_versioning_test.rb +0 -118
  406. data/test/multiverse/suites/grape/grape_versioning_test_api.rb +0 -130
  407. data/test/multiverse/suites/grape/unsupported_version_test.rb +0 -28
  408. data/test/multiverse/suites/high_security/Envfile +0 -3
  409. data/test/multiverse/suites/high_security/config/newrelic.yml +0 -69
  410. data/test/multiverse/suites/high_security/high_security_test.rb +0 -214
  411. data/test/multiverse/suites/httpclient/Envfile +0 -15
  412. data/test/multiverse/suites/httpclient/config/newrelic.yml +0 -17
  413. data/test/multiverse/suites/httpclient/httpclient_test.rb +0 -75
  414. data/test/multiverse/suites/httprb/Envfile +0 -21
  415. data/test/multiverse/suites/httprb/config/newrelic.yml +0 -17
  416. data/test/multiverse/suites/httprb/httprb_test.rb +0 -78
  417. data/test/multiverse/suites/json/Envfile +0 -22
  418. data/test/multiverse/suites/json/config/newrelic.yml +0 -21
  419. data/test/multiverse/suites/json/json_test.rb +0 -16
  420. data/test/multiverse/suites/marshalling/Envfile +0 -3
  421. data/test/multiverse/suites/marshalling/config/newrelic.yml +0 -19
  422. data/test/multiverse/suites/marshalling/marshalling_test.rb +0 -16
  423. data/test/multiverse/suites/memcached/Envfile +0 -36
  424. data/test/multiverse/suites/memcached/dalli_test.rb +0 -163
  425. data/test/multiverse/suites/memcached/memcache_client_test.rb +0 -25
  426. data/test/multiverse/suites/memcached/memcache_test_cases.rb +0 -315
  427. data/test/multiverse/suites/memcached/memcached_test.rb +0 -179
  428. data/test/multiverse/suites/mongo/Envfile +0 -74
  429. data/test/multiverse/suites/mongo/config/newrelic.yml +0 -17
  430. data/test/multiverse/suites/mongo/helpers/mongo_operation_tests.rb +0 -551
  431. data/test/multiverse/suites/mongo/helpers/mongo_replica_set.rb +0 -97
  432. data/test/multiverse/suites/mongo/helpers/mongo_replica_set_test.rb +0 -82
  433. data/test/multiverse/suites/mongo/helpers/mongo_server.rb +0 -241
  434. data/test/multiverse/suites/mongo/helpers/mongo_server_test.rb +0 -176
  435. data/test/multiverse/suites/mongo/mongo2_instrumentation_test.rb +0 -493
  436. data/test/multiverse/suites/mongo/mongo_connection_test.rb +0 -40
  437. data/test/multiverse/suites/mongo/mongo_instrumentation_test.rb +0 -58
  438. data/test/multiverse/suites/mongo/mongo_unsupported_version_test.rb +0 -72
  439. data/test/multiverse/suites/net_http/Envfile +0 -6
  440. data/test/multiverse/suites/net_http/config/newrelic.yml +0 -17
  441. data/test/multiverse/suites/net_http/net_http_test.rb +0 -115
  442. data/test/multiverse/suites/padrino/Envfile +0 -19
  443. data/test/multiverse/suites/padrino/config/newrelic.yml +0 -21
  444. data/test/multiverse/suites/padrino/padrino_test.rb +0 -52
  445. data/test/multiverse/suites/rack/Envfile +0 -64
  446. data/test/multiverse/suites/rack/before_suite.rb +0 -12
  447. data/test/multiverse/suites/rack/builder_map_test.rb +0 -128
  448. data/test/multiverse/suites/rack/config/newrelic.yml +0 -17
  449. data/test/multiverse/suites/rack/example_app.rb +0 -119
  450. data/test/multiverse/suites/rack/http_response_code_test.rb +0 -49
  451. data/test/multiverse/suites/rack/nested_non_rack_app_test.rb +0 -66
  452. data/test/multiverse/suites/rack/puma_rack_builder_test.rb +0 -84
  453. data/test/multiverse/suites/rack/rack_auto_instrumentation_test.rb +0 -151
  454. data/test/multiverse/suites/rack/rack_cascade_test.rb +0 -44
  455. data/test/multiverse/suites/rack/rack_env_mutation_test.rb +0 -52
  456. data/test/multiverse/suites/rack/rack_parameter_filtering_test.rb +0 -49
  457. data/test/multiverse/suites/rack/rack_unsupported_version_test.rb +0 -43
  458. data/test/multiverse/suites/rack/response_content_type_test.rb +0 -49
  459. data/test/multiverse/suites/rack/url_map_test.rb +0 -155
  460. data/test/multiverse/suites/rails/Envfile +0 -61
  461. data/test/multiverse/suites/rails/action_cable_test.rb +0 -81
  462. data/test/multiverse/suites/rails/action_controller_live_rum_test.rb +0 -39
  463. data/test/multiverse/suites/rails/activejob_test.rb +0 -151
  464. data/test/multiverse/suites/rails/app.rb +0 -44
  465. data/test/multiverse/suites/rails/app/views/foos/_foo.html.haml +0 -1
  466. data/test/multiverse/suites/rails/app/views/views/_a_partial.html.erb +0 -2
  467. data/test/multiverse/suites/rails/app/views/views/_mid_partial.html.erb +0 -1
  468. data/test/multiverse/suites/rails/app/views/views/_top_partial.html.erb +0 -3
  469. data/test/multiverse/suites/rails/app/views/views/deep_partial.html.erb +0 -3
  470. data/test/multiverse/suites/rails/app/views/views/haml_view.html.haml +0 -6
  471. data/test/multiverse/suites/rails/app/views/views/index.html.erb +0 -4
  472. data/test/multiverse/suites/rails/bad_instrumentation_test.rb +0 -29
  473. data/test/multiverse/suites/rails/config/newrelic.yml +0 -29
  474. data/test/multiverse/suites/rails/dummy.txt +0 -1
  475. data/test/multiverse/suites/rails/error_tracing_test.rb +0 -346
  476. data/test/multiverse/suites/rails/gc_instrumentation_test.rb +0 -73
  477. data/test/multiverse/suites/rails/ignore_test.rb +0 -79
  478. data/test/multiverse/suites/rails/middleware_instrumentation_test.rb +0 -41
  479. data/test/multiverse/suites/rails/middlewares.rb +0 -19
  480. data/test/multiverse/suites/rails/parameter_capture_test.rb +0 -328
  481. data/test/multiverse/suites/rails/queue_time_test.rb +0 -89
  482. data/test/multiverse/suites/rails/rails2_app/app/controllers/application.rb +0 -7
  483. data/test/multiverse/suites/rails/rails2_app/config/boot.rb +0 -127
  484. data/test/multiverse/suites/rails/rails2_app/config/database.yml +0 -18
  485. data/test/multiverse/suites/rails/rails2_app/config/environment.rb +0 -16
  486. data/test/multiverse/suites/rails/rails2_app/config/environments/development.rb +0 -10
  487. data/test/multiverse/suites/rails/rails2_app/config/initializers/load_newrelic_rpm.rb +0 -9
  488. data/test/multiverse/suites/rails/rails2_app/config/preinitializer.rb +0 -25
  489. data/test/multiverse/suites/rails/rails2_app/config/routes.rb +0 -19
  490. data/test/multiverse/suites/rails/rails2_app/db/schema.rb +0 -5
  491. data/test/multiverse/suites/rails/rails3_app/app_rails3_plus.rb +0 -99
  492. data/test/multiverse/suites/rails/request_statistics_test.rb +0 -192
  493. data/test/multiverse/suites/rails/transaction_ignoring_test.rb +0 -41
  494. data/test/multiverse/suites/rails/view_instrumentation_test.rb +0 -254
  495. data/test/multiverse/suites/rake/Envfile +0 -43
  496. data/test/multiverse/suites/rake/Rakefile +0 -54
  497. data/test/multiverse/suites/rake/config/newrelic.yml +0 -17
  498. data/test/multiverse/suites/rake/multitask_test.rb +0 -40
  499. data/test/multiverse/suites/rake/rake_test.rb +0 -209
  500. data/test/multiverse/suites/rake/rake_test_helper.rb +0 -66
  501. data/test/multiverse/suites/rake/unsupported_rake_test.rb +0 -19
  502. data/test/multiverse/suites/redis/Envfile +0 -23
  503. data/test/multiverse/suites/redis/config/newrelic.yml +0 -18
  504. data/test/multiverse/suites/redis/redis_instrumentation_test.rb +0 -331
  505. data/test/multiverse/suites/redis/redis_unsupported_version_test.rb +0 -20
  506. data/test/multiverse/suites/resque/Envfile +0 -9
  507. data/test/multiverse/suites/resque/Rakefile +0 -3
  508. data/test/multiverse/suites/resque/config/newrelic.yml +0 -18
  509. data/test/multiverse/suites/resque/instrumentation_test.rb +0 -159
  510. data/test/multiverse/suites/resque/resque_marshalling_test.rb +0 -61
  511. data/test/multiverse/suites/sequel/Envfile +0 -41
  512. data/test/multiverse/suites/sequel/config/newrelic.yml +0 -17
  513. data/test/multiverse/suites/sequel/database.rb +0 -54
  514. data/test/multiverse/suites/sequel/sequel_extension_test.rb +0 -142
  515. data/test/multiverse/suites/sequel/sequel_helpers.rb +0 -62
  516. data/test/multiverse/suites/sequel/sequel_plugin_test.rb +0 -230
  517. data/test/multiverse/suites/sequel/sequel_safety_test.rb +0 -30
  518. data/test/multiverse/suites/sidekiq/Envfile +0 -43
  519. data/test/multiverse/suites/sidekiq/after_suite.rb +0 -16
  520. data/test/multiverse/suites/sidekiq/config/newrelic.yml +0 -19
  521. data/test/multiverse/suites/sidekiq/log/.gitkeep +0 -0
  522. data/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +0 -220
  523. data/test/multiverse/suites/sidekiq/sidekiq_server.rb +0 -35
  524. data/test/multiverse/suites/sidekiq/test_model.rb +0 -12
  525. data/test/multiverse/suites/sidekiq/test_worker.rb +0 -71
  526. data/test/multiverse/suites/sinatra/Envfile +0 -27
  527. data/test/multiverse/suites/sinatra/config/newrelic.yml +0 -20
  528. data/test/multiverse/suites/sinatra/ignoring_test.rb +0 -226
  529. data/test/multiverse/suites/sinatra/nested_middleware_test.rb +0 -47
  530. data/test/multiverse/suites/sinatra/sinatra_classic_test.rb +0 -103
  531. data/test/multiverse/suites/sinatra/sinatra_error_tracing_test.rb +0 -48
  532. data/test/multiverse/suites/sinatra/sinatra_metric_explosion_test.rb +0 -102
  533. data/test/multiverse/suites/sinatra/sinatra_modular_test.rb +0 -93
  534. data/test/multiverse/suites/sinatra/sinatra_parameter_capture_test.rb +0 -82
  535. data/test/multiverse/suites/sinatra/sinatra_routes_test.rb +0 -49
  536. data/test/multiverse/suites/sinatra/sinatra_test_cases.rb +0 -226
  537. data/test/multiverse/suites/typhoeus/Envfile +0 -68
  538. data/test/multiverse/suites/typhoeus/config/newrelic.yml +0 -17
  539. data/test/multiverse/suites/typhoeus/typhoeus_test.rb +0 -145
  540. data/test/multiverse/suites/yajl/Envfile +0 -20
  541. data/test/multiverse/suites/yajl/config/newrelic.yml +0 -20
  542. data/test/multiverse/suites/yajl/yajl_test.rb +0 -16
  543. data/test/multiverse/test/multiverse_test.rb +0 -59
  544. data/test/multiverse/test/suite_examples/one/a/Envfile +0 -3
  545. data/test/multiverse/test/suite_examples/one/a/a_test.rb +0 -14
  546. data/test/multiverse/test/suite_examples/one/a/config/newrelic.yml +0 -21
  547. data/test/multiverse/test/suite_examples/one/b/Envfile +0 -3
  548. data/test/multiverse/test/suite_examples/one/b/b_test.rb +0 -14
  549. data/test/multiverse/test/suite_examples/one/b/config/newrelic.yml +0 -21
  550. data/test/multiverse/test/suite_examples/three/a/Envfile +0 -2
  551. data/test/multiverse/test/suite_examples/three/a/fail_test.rb +0 -10
  552. data/test/multiverse/test/suite_examples/three/b/Envfile +0 -2
  553. data/test/multiverse/test/suite_examples/three/b/win_test.rb +0 -10
  554. data/test/multiverse/test/suite_examples/two/a/Envfile +0 -1
  555. data/test/multiverse/test/suite_examples/two/a/fail_test.rb +0 -10
  556. data/test/new_relic/FAKECHANGELOG +0 -21
  557. data/test/new_relic/agent/agent/connect_test.rb +0 -299
  558. data/test/new_relic/agent/agent/start_test.rb +0 -188
  559. data/test/new_relic/agent/agent/start_worker_thread_test.rb +0 -74
  560. data/test/new_relic/agent/agent_logger_test.rb +0 -389
  561. data/test/new_relic/agent/agent_test.rb +0 -710
  562. data/test/new_relic/agent/agent_test_controller.rb +0 -84
  563. data/test/new_relic/agent/apdex_from_server_test.rb +0 -13
  564. data/test/new_relic/agent/api_tests/datastore_api_test.rb +0 -64
  565. data/test/new_relic/agent/attribute_filter_test.rb +0 -218
  566. data/test/new_relic/agent/attribute_processing_test.rb +0 -164
  567. data/test/new_relic/agent/audit_logger_test.rb +0 -208
  568. data/test/new_relic/agent/autostart_test.rb +0 -79
  569. data/test/new_relic/agent/aws_info_test.rb +0 -76
  570. data/test/new_relic/agent/busy_calculator_test.rb +0 -104
  571. data/test/new_relic/agent/commands/agent_command_router_test.rb +0 -256
  572. data/test/new_relic/agent/commands/agent_command_test.rb +0 -37
  573. data/test/new_relic/agent/commands/thread_profiler_session_test.rb +0 -216
  574. data/test/new_relic/agent/commands/xray_session_collection_test.rb +0 -332
  575. data/test/new_relic/agent/commands/xray_session_test.rb +0 -42
  576. data/test/new_relic/agent/configuration/default_source_test.rb +0 -229
  577. data/test/new_relic/agent/configuration/dotted_hash_test.rb +0 -53
  578. data/test/new_relic/agent/configuration/environment_source_test.rb +0 -201
  579. data/test/new_relic/agent/configuration/high_security_source_test.rb +0 -92
  580. data/test/new_relic/agent/configuration/manager_test.rb +0 -455
  581. data/test/new_relic/agent/configuration/manual_source_test.rb +0 -18
  582. data/test/new_relic/agent/configuration/orphan_configuration_test.rb +0 -91
  583. data/test/new_relic/agent/configuration/server_source_test.rb +0 -202
  584. data/test/new_relic/agent/configuration/yaml_source_test.rb +0 -117
  585. data/test/new_relic/agent/cross_app_monitor_test.rb +0 -248
  586. data/test/new_relic/agent/custom_event_aggregator_test.rb +0 -127
  587. data/test/new_relic/agent/database/postgres_explain_obfuscator_test.rb +0 -34
  588. data/test/new_relic/agent/database/sql_obfuscation_test.rb +0 -52
  589. data/test/new_relic/agent/database_test.rb +0 -482
  590. data/test/new_relic/agent/datastores/metric_helper_test.rb +0 -203
  591. data/test/new_relic/agent/datastores/mongo/event_formatter_test.rb +0 -175
  592. data/test/new_relic/agent/datastores/mongo/metric_translator_test.rb +0 -270
  593. data/test/new_relic/agent/datastores/mongo/obfuscator_test.rb +0 -99
  594. data/test/new_relic/agent/datastores/mongo/statement_formatter_test.rb +0 -72
  595. data/test/new_relic/agent/datastores/redis_test.rb +0 -126
  596. data/test/new_relic/agent/datastores_test.rb +0 -202
  597. data/test/new_relic/agent/deprecator_test.rb +0 -52
  598. data/test/new_relic/agent/encoding_normalizer_test.rb +0 -69
  599. data/test/new_relic/agent/error_collector_test.rb +0 -407
  600. data/test/new_relic/agent/error_event_aggregator_test.rb +0 -237
  601. data/test/new_relic/agent/error_trace_aggregator_test.rb +0 -298
  602. data/test/new_relic/agent/event_aggregator_test.rb +0 -178
  603. data/test/new_relic/agent/event_buffer_test_cases.rb +0 -168
  604. data/test/new_relic/agent/event_listener_test.rb +0 -70
  605. data/test/new_relic/agent/event_loop_test.rb +0 -202
  606. data/test/new_relic/agent/harvester_test.rb +0 -79
  607. data/test/new_relic/agent/hostname_test.rb +0 -121
  608. data/test/new_relic/agent/http_clients/uri_util_test.rb +0 -64
  609. data/test/new_relic/agent/inbound_request_monitor_test.rb +0 -49
  610. data/test/new_relic/agent/instrumentation/action_cable_subscriber_test.rb +0 -124
  611. data/test/new_relic/agent/instrumentation/action_controller_subscriber_test.rb +0 -299
  612. data/test/new_relic/agent/instrumentation/action_view_subscriber_test.rb +0 -249
  613. data/test/new_relic/agent/instrumentation/active_job_test.rb +0 -20
  614. data/test/new_relic/agent/instrumentation/active_record_helper_test.rb +0 -66
  615. data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +0 -210
  616. data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +0 -328
  617. data/test/new_relic/agent/instrumentation/delayed_job_instrumentation_test.rb +0 -23
  618. data/test/new_relic/agent/instrumentation/instance_identification_test.rb +0 -169
  619. data/test/new_relic/agent/instrumentation/instrumentation_test.rb +0 -14
  620. data/test/new_relic/agent/instrumentation/middleware_proxy_test.rb +0 -256
  621. data/test/new_relic/agent/instrumentation/middleware_tracing_test.rb +0 -49
  622. data/test/new_relic/agent/instrumentation/mongodb_command_subscriber_test.rb +0 -112
  623. data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +0 -41
  624. data/test/new_relic/agent/instrumentation/queue_time_test.rb +0 -103
  625. data/test/new_relic/agent/instrumentation/rack_test.rb +0 -44
  626. data/test/new_relic/agent/instrumentation/sequel_helper_test.rb +0 -36
  627. data/test/new_relic/agent/instrumentation/sinatra/transaction_namer_test.rb +0 -62
  628. data/test/new_relic/agent/instrumentation/sinatra_test.rb +0 -80
  629. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +0 -186
  630. data/test/new_relic/agent/javascript_instrumentor_test.rb +0 -340
  631. data/test/new_relic/agent/memory_logger_test.rb +0 -85
  632. data/test/new_relic/agent/method_interrobang_test.rb +0 -31
  633. data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +0 -112
  634. data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +0 -215
  635. data/test/new_relic/agent/method_tracer_test.rb +0 -480
  636. data/test/new_relic/agent/method_visibility_test.rb +0 -90
  637. data/test/new_relic/agent/mock_scope_listener.rb +0 -30
  638. data/test/new_relic/agent/new_relic_service/json_marshaller_test.rb +0 -27
  639. data/test/new_relic/agent/new_relic_service_test.rb +0 -972
  640. data/test/new_relic/agent/obfuscator_test.rb +0 -77
  641. data/test/new_relic/agent/parameter_filtering_test.rb +0 -39
  642. data/test/new_relic/agent/payload_metric_mapping_test.rb +0 -74
  643. data/test/new_relic/agent/pipe_channel_manager_test.rb +0 -315
  644. data/test/new_relic/agent/pipe_service_test.rb +0 -151
  645. data/test/new_relic/agent/rpm_agent_test.rb +0 -91
  646. data/test/new_relic/agent/rules_engine_test.rb +0 -136
  647. data/test/new_relic/agent/sampled_buffer_test.rb +0 -142
  648. data/test/new_relic/agent/sampler_collection_test.rb +0 -90
  649. data/test/new_relic/agent/sampler_test.rb +0 -66
  650. data/test/new_relic/agent/samplers/cpu_sampler_test.rb +0 -79
  651. data/test/new_relic/agent/samplers/memory_sampler_test.rb +0 -66
  652. data/test/new_relic/agent/samplers/vm_sampler_test.rb +0 -349
  653. data/test/new_relic/agent/sized_buffer_test.rb +0 -29
  654. data/test/new_relic/agent/sql_sampler_test.rb +0 -463
  655. data/test/new_relic/agent/stats_engine/gc_profiler_test.rb +0 -176
  656. data/test/new_relic/agent/stats_engine/stats_hash_test.rb +0 -195
  657. data/test/new_relic/agent/stats_engine_test.rb +0 -344
  658. data/test/new_relic/agent/stats_test.rb +0 -167
  659. data/test/new_relic/agent/synthetics_event_aggregator_test.rb +0 -180
  660. data/test/new_relic/agent/synthetics_event_buffer_test.rb +0 -54
  661. data/test/new_relic/agent/synthetics_monitor_test.rb +0 -93
  662. data/test/new_relic/agent/system_info_test.rb +0 -133
  663. data/test/new_relic/agent/threading/agent_thread_test.rb +0 -149
  664. data/test/new_relic/agent/threading/backtrace_node_test.rb +0 -184
  665. data/test/new_relic/agent/threading/backtrace_service_test.rb +0 -603
  666. data/test/new_relic/agent/threading/fake_thread.rb +0 -43
  667. data/test/new_relic/agent/threading/thread_profile_test.rb +0 -271
  668. data/test/new_relic/agent/threading/threaded_test_case.rb +0 -18
  669. data/test/new_relic/agent/traced_method_stack_test.rb +0 -184
  670. data/test/new_relic/agent/transaction/abstract_segment_test.rb +0 -103
  671. data/test/new_relic/agent/transaction/attributes_test.rb +0 -268
  672. data/test/new_relic/agent/transaction/datastore_segment_test.rb +0 -336
  673. data/test/new_relic/agent/transaction/external_request_segment_test.rb +0 -335
  674. data/test/new_relic/agent/transaction/request_attributes_test.rb +0 -84
  675. data/test/new_relic/agent/transaction/segment_test.rb +0 -77
  676. data/test/new_relic/agent/transaction/slowest_sample_buffer_test.rb +0 -67
  677. data/test/new_relic/agent/transaction/synthetics_sample_buffer_test.rb +0 -38
  678. data/test/new_relic/agent/transaction/trace_node_test.rb +0 -342
  679. data/test/new_relic/agent/transaction/trace_test.rb +0 -394
  680. data/test/new_relic/agent/transaction/tracing_test.rb +0 -176
  681. data/test/new_relic/agent/transaction/xray_sample_buffer_test.rb +0 -71
  682. data/test/new_relic/agent/transaction_error_primitive_test.rb +0 -117
  683. data/test/new_relic/agent/transaction_event_aggregator_test.rb +0 -211
  684. data/test/new_relic/agent/transaction_event_primitive_test.rb +0 -195
  685. data/test/new_relic/agent/transaction_event_recorder_test.rb +0 -80
  686. data/test/new_relic/agent/transaction_interrobang_test.rb +0 -33
  687. data/test/new_relic/agent/transaction_metrics_test.rb +0 -113
  688. data/test/new_relic/agent/transaction_sample_builder_test.rb +0 -215
  689. data/test/new_relic/agent/transaction_sampler_test.rb +0 -857
  690. data/test/new_relic/agent/transaction_state_test.rb +0 -122
  691. data/test/new_relic/agent/transaction_test.rb +0 -1476
  692. data/test/new_relic/agent/transaction_timings_test.rb +0 -91
  693. data/test/new_relic/agent/utilization_data_test.rb +0 -258
  694. data/test/new_relic/agent/vm/monotonic_gc_profiler_test.rb +0 -42
  695. data/test/new_relic/agent/vm/mri_vm_test.rb +0 -40
  696. data/test/new_relic/agent/vm/snapshot_test.rb +0 -13
  697. data/test/new_relic/agent/vm_test.rb +0 -48
  698. data/test/new_relic/agent/worker_loop_test.rb +0 -98
  699. data/test/new_relic/agent_test.rb +0 -461
  700. data/test/new_relic/cli/commands/deployments_test.rb +0 -136
  701. data/test/new_relic/cli/commands/install_test.rb +0 -27
  702. data/test/new_relic/coerce_test.rb +0 -93
  703. data/test/new_relic/collection_helper_test.rb +0 -113
  704. data/test/new_relic/control/class_methods_test.rb +0 -52
  705. data/test/new_relic/control/frameworks/rails_test.rb +0 -29
  706. data/test/new_relic/control/instance_methods_test.rb +0 -50
  707. data/test/new_relic/control/instrumentation_test.rb +0 -41
  708. data/test/new_relic/control_test.rb +0 -167
  709. data/test/new_relic/data_container_tests.rb +0 -87
  710. data/test/new_relic/dependency_detection_test.rb +0 -155
  711. data/test/new_relic/dispatcher_test.rb +0 -60
  712. data/test/new_relic/environment_report_test.rb +0 -107
  713. data/test/new_relic/evil_server.rb +0 -55
  714. data/test/new_relic/fake_collector.rb +0 -390
  715. data/test/new_relic/fake_external_server.rb +0 -65
  716. data/test/new_relic/fake_instance_metadata_service.rb +0 -45
  717. data/test/new_relic/fake_rpm_site.rb +0 -35
  718. data/test/new_relic/fake_server.rb +0 -104
  719. data/test/new_relic/filtering_test_app.rb +0 -19
  720. data/test/new_relic/framework_test.rb +0 -58
  721. data/test/new_relic/http_client_test_cases.rb +0 -639
  722. data/test/new_relic/language_support_test.rb +0 -98
  723. data/test/new_relic/latest_changes_test.rb +0 -34
  724. data/test/new_relic/license_test.rb +0 -115
  725. data/test/new_relic/load_test.rb +0 -15
  726. data/test/new_relic/local_environment_test.rb +0 -103
  727. data/test/new_relic/marshalling_test_cases.rb +0 -183
  728. data/test/new_relic/metric_data_test.rb +0 -144
  729. data/test/new_relic/metric_spec_test.rb +0 -144
  730. data/test/new_relic/multiverse_helpers.rb +0 -289
  731. data/test/new_relic/noticed_error_test.rb +0 -267
  732. data/test/new_relic/rack/agent_hooks_test.rb +0 -44
  733. data/test/new_relic/rack/agent_middleware_test.rb +0 -32
  734. data/test/new_relic/rack/browser_monitoring_test.rb +0 -195
  735. data/test/new_relic/transaction_ignoring_test_cases.rb +0 -102
  736. data/test/nullverse/default_source_require_test.rb +0 -21
  737. data/test/nullverse/nullverse_helper.rb +0 -10
  738. data/test/performance/README.md +0 -175
  739. data/test/performance/lib/performance.rb +0 -38
  740. data/test/performance/lib/performance/baseline.rb +0 -36
  741. data/test/performance/lib/performance/baseline_compare_reporter.rb +0 -103
  742. data/test/performance/lib/performance/baseline_save_reporter.rb +0 -24
  743. data/test/performance/lib/performance/console_reporter.rb +0 -66
  744. data/test/performance/lib/performance/formatting_helpers.rb +0 -22
  745. data/test/performance/lib/performance/hako_client.rb +0 -31
  746. data/test/performance/lib/performance/hako_reporter.rb +0 -26
  747. data/test/performance/lib/performance/instrumentation/cpu_usage.rb +0 -26
  748. data/test/performance/lib/performance/instrumentation/gc_stats.rb +0 -56
  749. data/test/performance/lib/performance/instrumentation/perf_tools.rb +0 -30
  750. data/test/performance/lib/performance/instrumentation/stackprof.rb +0 -46
  751. data/test/performance/lib/performance/instrumentor.rb +0 -96
  752. data/test/performance/lib/performance/json_reporter.rb +0 -15
  753. data/test/performance/lib/performance/platform.rb +0 -31
  754. data/test/performance/lib/performance/reporting.rb +0 -36
  755. data/test/performance/lib/performance/result.rb +0 -104
  756. data/test/performance/lib/performance/runner.rb +0 -221
  757. data/test/performance/lib/performance/table.rb +0 -105
  758. data/test/performance/lib/performance/test_case.rb +0 -152
  759. data/test/performance/lib/performance/timer.rb +0 -40
  760. data/test/performance/script/baselines +0 -102
  761. data/test/performance/script/mega-runner +0 -37
  762. data/test/performance/script/runner +0 -131
  763. data/test/performance/suites/active_record.rb +0 -26
  764. data/test/performance/suites/active_record_subscriber.rb +0 -100
  765. data/test/performance/suites/agent_attributes.rb +0 -62
  766. data/test/performance/suites/config.rb +0 -35
  767. data/test/performance/suites/datastores.rb +0 -59
  768. data/test/performance/suites/error_collector.rb +0 -28
  769. data/test/performance/suites/external_segment.rb +0 -80
  770. data/test/performance/suites/marshalling.rb +0 -148
  771. data/test/performance/suites/queue_time.rb +0 -21
  772. data/test/performance/suites/rack_middleware.rb +0 -134
  773. data/test/performance/suites/redis.rb +0 -45
  774. data/test/performance/suites/rules_engine.rb +0 -35
  775. data/test/performance/suites/rum_autoinsertion.rb +0 -75
  776. data/test/performance/suites/segment_terms_rule.rb +0 -27
  777. data/test/performance/suites/sql_obfuscation.rb +0 -50
  778. data/test/performance/suites/startup.rb +0 -12
  779. data/test/performance/suites/stats_hash.rb +0 -31
  780. data/test/performance/suites/thread_profiling.rb +0 -116
  781. data/test/performance/suites/trace_execution_scoped.rb +0 -31
  782. data/test/performance/suites/transaction_tracing.rb +0 -105
  783. data/test/script/before_install/gemstash_mirror.sh +0 -10
  784. data/test/script/before_script/install_mongodb.sh +0 -12
  785. data/test/script/ci.sh +0 -15
  786. data/test/script/external_server.rb +0 -31
  787. data/test/script/path_hash.rb +0 -49
  788. data/test/test_helper.rb +0 -59
@@ -1,122 +0,0 @@
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 File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
6
- require 'new_relic/agent/transaction'
7
- require 'new_relic/agent/transaction_state'
8
-
9
- module NewRelic::Agent
10
- class TransactionStateTest < Minitest::Test
11
- attr_reader :state
12
-
13
- def setup
14
- TransactionState.tl_clear_for_testing
15
- @state = TransactionState.tl_get
16
- end
17
-
18
- def teardown
19
- TransactionState.tl_clear_for_testing
20
- end
21
-
22
- def test_without_transaction_stack_on_thread
23
- assert_equal false, state.in_background_transaction?
24
- assert_equal false, state.in_web_transaction?
25
- end
26
-
27
- def test_in_background_transaction
28
- in_transaction(:category => :task) do |txn|
29
- assert state.in_background_transaction?
30
- end
31
- end
32
-
33
- def test_in_request_tranasction
34
- in_web_transaction do
35
- assert state.in_web_transaction?
36
- end
37
- end
38
-
39
- def test_timings_with_transaction
40
- earliest_time = freeze_time
41
-
42
- in_transaction("Transaction/name") do |txn|
43
- txn.apdex_start = earliest_time
44
- txn.start_time = earliest_time + 5
45
-
46
- advance_time(10.0)
47
- timings = state.timings
48
-
49
- assert_equal 5.0, timings.queue_time_in_seconds
50
- assert_equal 5.0, timings.app_time_in_seconds
51
- assert_equal txn.best_name, timings.transaction_name
52
- end
53
- end
54
-
55
- def test_guid_from_transaction
56
- in_transaction do |txn|
57
- assert_equal state.request_guid, txn.guid
58
- end
59
- end
60
-
61
- def test_reset_should_reset_cat_state
62
- state.is_cross_app_caller = true
63
- state.referring_transaction_info = ['foo', 'bar']
64
-
65
- assert_equal(true, state.is_cross_app_callee?)
66
- assert_equal(true, state.is_cross_app_caller?)
67
-
68
- state.reset
69
-
70
- assert_equal(false, state.is_cross_app_caller?)
71
- assert_equal(false, state.is_cross_app_callee?)
72
- end
73
-
74
- def test_reset_forces_traced_method_stack_clear
75
- state.traced_method_stack.push_frame(state, :reset_me)
76
- state.reset
77
- assert_empty state.traced_method_stack
78
- end
79
-
80
- def test_reset_doesnt_touch_record_tt
81
- state.record_tt = false
82
- state.reset
83
- refute state.record_tt
84
- end
85
-
86
- def test_reset_doesnt_touch_record_sql
87
- state.record_sql = false
88
- state.reset
89
- refute state.record_sql
90
- end
91
-
92
- def test_reset_doesnt_touch_untraced_stack
93
- state.push_traced(true)
94
- state.reset
95
- assert_equal [true], state.untraced
96
- end
97
-
98
- def test_reset_touches_everything!
99
- state.request = ::Rack::Request.new({})
100
- state.is_cross_app_caller = true
101
- state.client_cross_app_id = :client_cross_app_id
102
- state.referring_transaction_info = :referring_transaction_info
103
- state.busy_entries = 1
104
- state.sql_sampler_transaction_data = Object.new
105
- state.transaction_sample_builder = Object.new
106
- state.push_traced(true)
107
-
108
- state.reset
109
-
110
- # Anything in this list should be tested explicitly by itself!
111
- skip_checking = [:@traced_method_stack, :@record_tt, :@record_sql,
112
- :@untraced]
113
- variables = state.instance_variables.map(&:to_sym) - skip_checking
114
-
115
- variables.each do |ivar|
116
- value = state.instance_variable_get(ivar)
117
- assert [0, nil, false, []].include?(value),
118
- "Expected #{ivar} to reset, but was #{value}"
119
- end
120
- end
121
- end
122
- end
@@ -1,1476 +0,0 @@
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 File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
6
-
7
- class NewRelic::Agent::TransactionTest < Minitest::Test
8
-
9
- def setup
10
- @stats_engine = NewRelic::Agent.instance.stats_engine
11
- @stats_engine.reset!
12
- NewRelic::Agent.instance.error_collector.drop_buffered_data
13
- end
14
-
15
- def teardown
16
- # Failed transactions can leave partial stack, so pave it for next test
17
-
18
- ::NewRelic::Agent.logger.clear_already_logged
19
- cleanup_transaction
20
- end
21
-
22
- def cleanup_transaction
23
- NewRelic::Agent::TransactionState.tl_clear_for_testing
24
- end
25
-
26
- def test_request_parsing_none
27
- in_transaction do |txn|
28
- assert_nil txn.request_path
29
- assert_nil txn.referer
30
- end
31
- end
32
-
33
- # note: technically this shouldn't happen if the request we are dealing with is
34
- # a Rack::Request (or subclass such as ActionDispatch::Request or the old
35
- # ActionController::AbstractRequest)
36
- def test_request_with_path_with_query_string
37
- request = stub(:path => '/path?hello=bob#none')
38
- in_transaction(:request => request) do |txn|
39
- assert_equal "/path", txn.request_path
40
- end
41
- end
42
-
43
- def test_request_parsing_referer
44
- request = stub(:referer => 'https://www.yahoo.com:8080/path/hello?bob=none&foo=bar', :path => "/")
45
- in_transaction(:request => request) do |txn|
46
- assert_equal "https://www.yahoo.com:8080/path/hello", txn.referer
47
- end
48
- end
49
-
50
- def test_strips_query_string_from_path_and_referer
51
- request = stub(:path => '/path?hello=bob#none', :referer => '/path/hello?bob=none&foo=bar')
52
- in_transaction(:request => request) do |txn|
53
- assert_equal "/path", txn.request_path
54
- assert_equal "/path/hello", txn.referer
55
- end
56
- end
57
-
58
- def test_transaction_referer_nil_if_request_referer_nil
59
- request = stub(:path => '/path?hello=bob#none', :referer => nil)
60
- in_transaction(:request => request) do |txn|
61
- assert_nil txn.referer
62
- end
63
- end
64
-
65
- def test_request_with_normal_path
66
- request = stub(:path => '/blogs')
67
- in_transaction(:request => request) do |txn|
68
- assert_equal "/blogs", txn.request_path
69
- assert_nil txn.referer
70
- end
71
- end
72
-
73
- def test_request_with_empty_path
74
- request = stub(:path => '')
75
- in_transaction(:request => request) do |txn|
76
- assert_equal "/", txn.request_path
77
- assert_nil txn.referer
78
- end
79
- end
80
-
81
- def test_request_to_root_path
82
- request = stub(:path => '/')
83
- in_transaction(:request => request) do |txn|
84
- assert_equal "/", txn.request_path
85
- assert_nil txn.referer
86
- end
87
- end
88
-
89
- def test_request_with_empty_path_with_query_string
90
- request = stub(:path => '?k=v')
91
- in_transaction(:request => request) do |txn|
92
- assert_equal "/", txn.request_path
93
- assert_nil txn.referer
94
- end
95
- end
96
-
97
- def test_queue_time
98
- in_transaction do |txn|
99
- txn.apdex_start = 1000
100
- txn.start_time = 1500
101
- assert_equal 500, txn.queue_time
102
- end
103
- end
104
-
105
- def test_apdex_bucket_counts_errors_as_frustrating
106
- bucket = NewRelic::Agent::Transaction.apdex_bucket(0.1, true, 2)
107
- assert_equal(:apdex_f, bucket)
108
- end
109
-
110
- def test_apdex_bucket_counts_values_under_apdex_t_as_satisfying
111
- bucket = NewRelic::Agent::Transaction.apdex_bucket(0.5, false, 1)
112
- assert_equal(:apdex_s, bucket)
113
- end
114
-
115
- def test_apdex_bucket_counts_values_of_1_to_4x_apdex_t_as_tolerating
116
- bucket = NewRelic::Agent::Transaction.apdex_bucket(1.01, false, 1)
117
- assert_equal(:apdex_t, bucket)
118
- bucket = NewRelic::Agent::Transaction.apdex_bucket(3.99, false, 1)
119
- assert_equal(:apdex_t, bucket)
120
- end
121
-
122
- def test_apdex_bucket_count_values_over_4x_apdex_t_as_frustrating
123
- bucket = NewRelic::Agent::Transaction.apdex_bucket(4.01, false, 1)
124
- assert_equal(:apdex_f, bucket)
125
- end
126
-
127
- def test_has_correct_apdex_t_for_transaction
128
- config = {
129
- :web_transactions_apdex => {'Controller/foo/bar' => 1.5},
130
- :apdex_t => 2.0
131
- }
132
-
133
- with_config(config) do
134
- in_transaction('Controller/foo/bar') do |txn|
135
- assert_equal 1.5, txn.apdex_t
136
- end
137
-
138
- in_transaction('Controller/some/other') do |txn|
139
- assert_equal 2.0, txn.apdex_t
140
- end
141
- end
142
- end
143
-
144
- KEY_TRANSACTION_CONFIG = {
145
- :web_transactions_apdex => {
146
- 'Controller/slow/txn' => 4,
147
- 'OtherTransaction/back/ground' => 8
148
- },
149
- :apdex => 1
150
- }
151
-
152
- def test_update_apdex_records_correct_apdex_for_key_transaction
153
- t0 = freeze_time
154
-
155
- with_config(KEY_TRANSACTION_CONFIG) do
156
- in_web_transaction('Controller/slow/txn') do
157
- state = NewRelic::Agent::TransactionState.tl_get
158
- txn = state.current_transaction
159
- txn.record_apdex(state, t0 + 3.5)
160
- txn.record_apdex(state, t0 + 5.5)
161
- txn.record_apdex(state, t0 + 16.5)
162
- end
163
-
164
- # apdex_s is 2 because the transaction itself records apdex
165
- assert_metrics_recorded(
166
- 'ApdexAll' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
167
- 'Apdex' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
168
- 'Apdex/slow/txn' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 }
169
- )
170
- end
171
- end
172
-
173
- def test_update_apdex_records_correct_apdex_for_non_key_transaction
174
- t0 = freeze_time
175
-
176
- with_config(KEY_TRANSACTION_CONFIG) do
177
- in_web_transaction('Controller/other/txn') do
178
- state = NewRelic::Agent::TransactionState.tl_get
179
- txn = state.current_transaction
180
- txn.record_apdex(state, t0 + 0.5)
181
- txn.record_apdex(state, t0 + 2)
182
- txn.record_apdex(state, t0 + 5)
183
- end
184
-
185
- # apdex_s is 2 because the transaction itself records apdex
186
- assert_metrics_recorded(
187
- 'ApdexAll' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
188
- 'Apdex' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
189
- 'Apdex/other/txn' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 }
190
- )
191
- end
192
- end
193
-
194
- def test_update_apdex_records_for_background_key_transaction
195
- t0 = freeze_time
196
- with_config(KEY_TRANSACTION_CONFIG) do
197
- in_background_transaction('OtherTransaction/back/ground') do
198
- state = NewRelic::Agent::TransactionState.tl_get
199
- txn = state.current_transaction
200
- txn.record_apdex(state, t0 + 7.5)
201
- txn.record_apdex(state, t0 + 9.5)
202
- txn.record_apdex(state, t0 + 32.5)
203
- end
204
-
205
- assert_metrics_recorded(
206
- 'ApdexAll' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
207
- 'ApdexOther' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
208
- 'ApdexOther/Transaction/back/ground' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 }
209
- )
210
- end
211
- end
212
-
213
- def test_skips_apdex_records_for_background_non_key_transaction
214
- t0 = freeze_time
215
- with_config(KEY_TRANSACTION_CONFIG) do
216
- in_background_transaction('OtherTransaction/other/task') do
217
- state = NewRelic::Agent::TransactionState.tl_get
218
- txn = state.current_transaction
219
- txn.record_apdex(state, t0 + 7.5)
220
- txn.record_apdex(state, t0 + 9.5)
221
- txn.record_apdex(state, t0 + 32.5)
222
- end
223
-
224
- refute_metrics_recorded(['ApdexOther', 'ApdexOther/Transaction/other/task'])
225
- end
226
- end
227
-
228
- def test_record_apdex_stores_apdex_t_in_min_and_max
229
- with_config(:apdex_t => 2.5) do
230
- in_web_transaction('Controller/some/txn') do
231
- state = NewRelic::Agent::TransactionState.tl_get
232
- txn = state.current_transaction
233
- txn.record_apdex(state, Time.now)
234
- end
235
- end
236
-
237
- expected = { :min_call_time => 2.5, :max_call_time => 2.5 }
238
- assert_metrics_recorded(
239
- 'ApdexAll' => expected,
240
- 'Apdex' => expected,
241
- 'Apdex/some/txn' => expected
242
- )
243
- end
244
-
245
- def test_records_apdex_all_for_both_transaction_types
246
- t0 = freeze_time
247
- with_config(KEY_TRANSACTION_CONFIG) do
248
- in_background_transaction('OtherTransaction/back/ground') do
249
- state = NewRelic::Agent::TransactionState.tl_get
250
- txn = state.current_transaction
251
- txn.record_apdex(state, t0 + 7.5)
252
- txn.record_apdex(state, t0 + 9.5)
253
- txn.record_apdex(state, t0 + 32.5)
254
- end
255
-
256
- in_web_transaction('Controller/slow/txn') do
257
- state = NewRelic::Agent::TransactionState.tl_get
258
- txn = state.current_transaction
259
- txn.record_apdex(state, t0 + 3.5)
260
- txn.record_apdex(state, t0 + 5.5)
261
- txn.record_apdex(state, t0 + 16.5)
262
- end
263
-
264
- # apdex_s is 2 because the transaction itself records apdex
265
- assert_metrics_recorded(
266
- 'ApdexAll' => { :apdex_s => 4, :apdex_t => 2, :apdex_f => 2 },
267
- 'Apdex' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
268
- 'Apdex/slow/txn' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
269
- 'ApdexOther' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 },
270
- 'ApdexOther/Transaction/back/ground' => { :apdex_s => 2, :apdex_t => 1, :apdex_f => 1 }
271
- )
272
- end
273
- end
274
-
275
- class SillyError < StandardError
276
- end
277
-
278
- def test_apdex_success_with_ignored_error
279
- filter = Proc.new do |error|
280
- error.is_a?(SillyError) ? nil : error
281
- end
282
-
283
- with_ignore_error_filter(filter) do
284
- txn_name = 'Controller/whatever'
285
- in_web_transaction(txn_name) do
286
- NewRelic::Agent::Transaction.notice_error(SillyError.new)
287
- end
288
-
289
- in_web_transaction(txn_name) do
290
- NewRelic::Agent::Transaction.notice_error(RuntimeError.new)
291
- end
292
- end
293
-
294
- assert_metrics_recorded(
295
- 'Apdex' => { :apdex_s => 1, :apdex_t => 0, :apdex_f => 1 },
296
- 'Apdex/whatever' => { :apdex_s => 1, :apdex_t => 0, :apdex_f => 1 }
297
- )
298
- end
299
-
300
- def test_apdex_success_with_config_ignored_error
301
- txn_name = 'Controller/whatever'
302
- with_config(:'error_collector.ignore_errors' => SillyError.name) do
303
- in_web_transaction(txn_name) do
304
- NewRelic::Agent::Transaction.notice_error(SillyError.new)
305
- end
306
-
307
- in_web_transaction(txn_name) do
308
- NewRelic::Agent::Transaction.notice_error(RuntimeError.new)
309
- end
310
-
311
- assert_metrics_recorded(
312
- 'Apdex' => { :apdex_s => 1, :apdex_t => 0, :apdex_f => 1 },
313
- 'Apdex/whatever' => { :apdex_s => 1, :apdex_t => 0, :apdex_f => 1 }
314
- )
315
- end
316
- end
317
-
318
- def test_name_is_unset_if_nil
319
- in_transaction(:transaction_name => nil) do |txn|
320
- assert !txn.name_set?
321
- end
322
- end
323
-
324
- def test_name_set_if_anything_else
325
- in_transaction("anything else") do |txn|
326
- assert txn.name_set?
327
- end
328
- end
329
-
330
- def test_set_default_transaction_name_without_category
331
- in_transaction('foo', :category => :controller) do |txn|
332
- NewRelic::Agent::Transaction.set_default_transaction_name('bar')
333
- assert_equal("Controller/bar", txn.best_name)
334
- assert_equal("Controller/bar", txn.frame_stack.last.name)
335
- end
336
- end
337
-
338
- def test_set_default_transaction_name_with_category
339
- in_transaction('foo', :category => :controller) do |txn|
340
- NewRelic::Agent::Transaction.set_default_transaction_name('bar', :rack)
341
- assert_equal("Controller/Rack/bar", txn.best_name)
342
- assert_equal("Controller/Rack/bar", txn.frame_stack.last.name)
343
- end
344
- end
345
-
346
- def test_set_default_transaction_name_with_category_and_node_name
347
- in_transaction('foo', :category => :controller) do |txn|
348
- NewRelic::Agent::Transaction.set_default_transaction_name('bar', :grape, 'baz')
349
- assert_equal("Controller/Grape/bar", txn.best_name)
350
- assert_equal("baz", txn.frame_stack.last.name)
351
- end
352
- end
353
-
354
- def test_generates_guid_on_initialization
355
- in_transaction do |txn|
356
- refute_empty txn.guid
357
- end
358
- end
359
-
360
- def test_end_applies_transaction_name_rules
361
- rules = [
362
- {
363
- 'match_expression' => '[0-9]+',
364
- 'replacement' => '*',
365
- 'replace_all' => true
366
- }
367
- ]
368
-
369
- with_transaction_renaming_rules(rules) do
370
- in_transaction('Controller/foo/1/bar/22') do |txn|
371
- NewRelic::Agent::Transaction.tl_current.freeze_name_and_execute_if_not_ignored
372
- assert_equal 'Controller/foo/*/bar/*', txn.best_name
373
- end
374
- end
375
- end
376
-
377
- def test_end_fires_a_transaction_finished_event
378
- name, timestamp, duration = nil
379
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
380
- name = payload[:name]
381
- timestamp = payload[:start_timestamp]
382
- duration = payload[:duration]
383
- end
384
-
385
- start_time = freeze_time
386
- in_web_transaction('Controller/foo/1/bar/22') do
387
- advance_time(5)
388
- NewRelic::Agent::Transaction.tl_current.freeze_name_and_execute_if_not_ignored
389
- end
390
-
391
- assert_equal 'Controller/foo/1/bar/22', name
392
- assert_equal start_time.to_f, timestamp
393
- assert_equal 5.0, duration
394
- end
395
-
396
- def test_end_fires_a_transaction_finished_event_with_overview_metrics
397
- freeze_time
398
- options = nil
399
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
400
- options = payload[:metrics]
401
- end
402
-
403
- in_web_transaction('Controller/foo/1/bar/22') do
404
- NewRelic::Agent.record_metric("HttpDispatcher", 2.1)
405
- end
406
-
407
- assert_equal 2.1, options['HttpDispatcher'].total_call_time
408
- end
409
-
410
- def test_end_fires_a_transaction_finished_event_with_attributes_attached
411
- attributes = nil
412
-
413
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
414
- attributes = payload[:attributes]
415
- end
416
-
417
- txn = in_web_transaction('Controller/foo/1/bar/22') do
418
- end
419
-
420
- assert_equal txn.attributes, attributes
421
- end
422
-
423
- def test_end_fires_a_transaction_finished_event_with_transaction_guid
424
- guid = nil
425
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
426
- guid = payload[:guid]
427
- end
428
-
429
- in_transaction do
430
- NewRelic::Agent::TransactionState.tl_get.is_cross_app_caller = true
431
- end
432
-
433
- refute_empty guid
434
- end
435
-
436
- def test_end_fires_a_transaction_finished_event_without_transaction_guid_if_not_cross_app
437
- found_guid = :untouched
438
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
439
- found_guid = payload.key?(:guid)
440
- end
441
-
442
- in_transaction do
443
- NewRelic::Agent::TransactionState.tl_get.is_cross_app_caller = false
444
- end
445
-
446
- refute found_guid
447
- end
448
-
449
- def test_end_fires_a_transaction_finished_event_with_guid_if_referring_transaction
450
- guid = nil
451
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
452
- guid = payload[:guid]
453
- end
454
-
455
- with_config(:apdex_t => 2.0) do
456
- in_transaction do
457
- state = NewRelic::Agent::TransactionState.tl_get
458
- state.referring_transaction_info = ["another"]
459
- end
460
- end
461
-
462
- refute_empty guid
463
- end
464
-
465
- def test_end_fires_a_transaction_finished_event_with_referring_transaction_guid
466
- referring_guid = nil
467
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
468
- referring_guid = payload[:referring_transaction_guid]
469
- end
470
-
471
- in_transaction do
472
- NewRelic::Agent::TransactionState.tl_get.referring_transaction_info = ["GUID"]
473
- end
474
-
475
- assert_equal "GUID", referring_guid
476
- end
477
-
478
- def test_end_fires_a_transaction_finished_event_without_referring_guid_if_not_present
479
- found_referring_guid = :untouched
480
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
481
- found_referring_guid = payload.key?(:referring_transaction_guid)
482
- end
483
-
484
- in_transaction do
485
- # Make sure we don't have referring transaction state floating around
486
- NewRelic::Agent::TransactionState.tl_get.referring_transaction_info = nil
487
- end
488
-
489
- refute found_referring_guid
490
- end
491
-
492
- def test_end_fires_a_transaction_finished_event_with_apdex_perf_zone
493
- apdex = nil
494
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
495
- apdex = payload[:apdex_perf_zone]
496
- end
497
-
498
- freeze_time
499
-
500
- with_config(:apdex_t => 1.0) do
501
- in_web_transaction { advance_time 0.5 }
502
- assert_equal('S', apdex)
503
-
504
- in_web_transaction { advance_time 1.5 }
505
- assert_equal('T', apdex)
506
-
507
- in_web_transaction { advance_time 4.5 }
508
- assert_equal('F', apdex)
509
- end
510
- end
511
-
512
- def test_default_background_transaction_event_doesnt_include_apdex_perf_zone
513
- apdex = nil
514
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
515
- apdex = payload[:apdex_perf_zone]
516
- end
517
-
518
- freeze_time
519
-
520
- with_config(:apdex_t => 1.0) do
521
- in_background_transaction { advance_time 0.5 }
522
- assert_nil apdex
523
- end
524
- end
525
-
526
- def test_background_transaction_event_include_apdex_perf_zone_if_key_transaction
527
- apdex = nil
528
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
529
- apdex = payload[:apdex_perf_zone]
530
- end
531
-
532
- freeze_time
533
-
534
- txn_name = 'OtherTransaction/back/ground'
535
- key_transactions = { txn_name => 1.0 }
536
-
537
- with_config(:apdex_t => 1.0, :web_transactions_apdex => key_transactions) do
538
- in_background_transaction(txn_name) { advance_time 0.5 }
539
- assert_equal('S', apdex)
540
-
541
- in_background_transaction(txn_name) { advance_time 1.5 }
542
- assert_equal('T', apdex)
543
-
544
- in_background_transaction(txn_name) { advance_time 4.5 }
545
- assert_equal('F', apdex)
546
- end
547
- end
548
-
549
- def test_guid_in_finish_event_payload_if_incoming_synthetics_header
550
- keys = []
551
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
552
- keys = payload.keys
553
- end
554
-
555
- raw_synthetics_header = 'dummy data'
556
- synthetics_payload = [123, 456, 789, 111]
557
-
558
- in_transaction do |txn|
559
- txn.raw_synthetics_header = raw_synthetics_header
560
- txn.synthetics_payload = synthetics_payload
561
- end
562
-
563
- assert_includes keys, :guid
564
- end
565
-
566
- def test_cross_app_fields_in_finish_event_payload
567
- keys = []
568
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
569
- keys = payload.keys
570
- end
571
-
572
- in_transaction do
573
- NewRelic::Agent::TransactionState.tl_get.is_cross_app_caller = true
574
- end
575
-
576
- assert_includes keys, :cat_trip_id
577
- assert_includes keys, :cat_path_hash
578
- end
579
-
580
- def test_cross_app_fields_not_in_finish_event_payload_if_no_cross_app_calls
581
- keys = []
582
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
583
- keys = payload.keys
584
- end
585
-
586
- freeze_time
587
-
588
- in_transaction do
589
- advance_time(10)
590
-
591
- state = NewRelic::Agent::TransactionState.tl_get
592
- state.is_cross_app_caller = false
593
- end
594
-
595
- refute_includes keys, :cat_trip_id
596
- refute_includes keys, :cat_path_hash
597
- end
598
-
599
- def test_is_not_synthetic_request_without_payload
600
- in_transaction do |txn|
601
- txn.raw_synthetics_header = ""
602
- refute txn.is_synthetics_request?
603
- end
604
- end
605
-
606
- def test_is_not_synthetic_request_without_header
607
- in_transaction do |txn|
608
- txn.synthetics_payload = [1,2,3,4,5]
609
- refute txn.is_synthetics_request?
610
- end
611
- end
612
-
613
- def test_is_synthetic_request
614
- in_transaction do |txn|
615
- txn.raw_synthetics_header = ""
616
- txn.synthetics_payload = [1,2,3,4,5]
617
- assert txn.is_synthetics_request?
618
- end
619
- end
620
-
621
- def test_synthetics_accessors
622
- in_transaction do
623
- state = NewRelic::Agent::TransactionState.tl_get
624
- txn = state.current_transaction
625
- txn.synthetics_payload = [1,2,3,4,5]
626
-
627
- assert_equal 1, txn.synthetics_version
628
- assert_equal 2, txn.synthetics_account_id
629
- assert_equal 3, txn.synthetics_resource_id
630
- assert_equal 4, txn.synthetics_job_id
631
- assert_equal 5, txn.synthetics_monitor_id
632
- end
633
- end
634
-
635
- def test_synthetics_fields_in_finish_event_payload
636
- keys = []
637
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
638
- keys = payload.keys
639
- end
640
-
641
- in_transaction do |txn|
642
- txn.raw_synthetics_header = "something"
643
- txn.synthetics_payload = [1, 1, 100, 200, 300]
644
- end
645
-
646
- assert_includes keys, :synthetics_resource_id
647
- assert_includes keys, :synthetics_job_id
648
- assert_includes keys, :synthetics_monitor_id
649
- end
650
-
651
- def test_synthetics_fields_not_in_finish_event_payload_if_no_cross_app_calls
652
- keys = []
653
- NewRelic::Agent.subscribe(:transaction_finished) do |payload|
654
- keys = payload.keys
655
- end
656
-
657
- in_transaction do |txn|
658
- # Make totally sure we're not synthetic
659
- txn.raw_synthetics_header = nil
660
- end
661
-
662
- refute_includes keys, :synthetics_resource_id
663
- refute_includes keys, :synthetics_job_id
664
- refute_includes keys, :synthetics_monitor_id
665
- end
666
-
667
- def test_logs_warning_if_a_non_hash_arg_is_passed_to_add_custom_attributes
668
- expects_logging(:warn, includes("add_custom_attributes"))
669
- in_transaction do
670
- NewRelic::Agent.add_custom_attributes('fooz')
671
- end
672
- end
673
-
674
- def test_ignores_custom_attributes_when_in_high_security
675
- with_config(:high_security => true) do
676
- in_transaction do |txn|
677
- NewRelic::Agent.add_custom_attributes(:failure => "is an option")
678
- assert_empty attributes_for(txn, :custom)
679
- end
680
- end
681
- end
682
-
683
- def test_notice_error_in_current_transaction_saves_it_for_finishing
684
- in_transaction('failing') do |txn|
685
- NewRelic::Agent::Transaction.notice_error("")
686
- assert_equal 1, txn.exceptions.count
687
- end
688
- end
689
-
690
- def test_notice_error_in_transaction_sends_attributes_along
691
- txn = in_transaction('oops') do
692
- NewRelic::Agent::Transaction.notice_error("wat?")
693
- end
694
- errors = harvest_error_traces!
695
- error = errors.first
696
- assert_equal txn.attributes, error.attributes
697
- end
698
-
699
- def test_notice_error_after_current_transaction_notifies_error_collector
700
- in_transaction('failing') do
701
- # no-op
702
- end
703
- NewRelic::Agent::Transaction.notice_error("")
704
- errors = harvest_error_traces!
705
- assert_equal 1, errors.count
706
- end
707
-
708
- def test_notice_error_without_transaction_notifies_error_collector
709
- cleanup_transaction
710
- NewRelic::Agent::Transaction.notice_error("")
711
- errors = harvest_error_traces!
712
- assert_equal 1, errors.count
713
- end
714
-
715
- def test_notice_error_sends_uri_and_referer_from_request
716
- request = stub(:path => "/here")
717
- in_transaction(:request => request) do |txn|
718
- NewRelic::Agent::Transaction.notice_error("wat")
719
- end
720
-
721
- errors = harvest_error_traces!
722
- assert_equal 1, errors.count
723
-
724
- error = errors.first
725
- assert_equal "/here", error.request_uri
726
- end
727
-
728
- def test_records_gc_time
729
- gc_start = mock('gc start')
730
- gc_end = mock('gc end')
731
- NewRelic::Agent::StatsEngine::GCProfiler.stubs(:take_snapshot).returns(gc_start, gc_end)
732
-
733
- txn = in_transaction do |transaction|
734
- NewRelic::Agent::StatsEngine::GCProfiler.expects(:record_delta).with(gc_start, gc_end).returns(42)
735
- transaction
736
- end
737
-
738
- trace = txn.transaction_trace
739
- assert_equal(42, attributes_for(trace, :intrinsic)[:gc_time])
740
- end
741
-
742
- def test_freeze_name_and_execute_if_not_ignored_executes_given_block_if_not_ignored
743
- NewRelic::Agent.instance.transaction_rules.expects(:rename).
744
- returns('non-ignored-transaction')
745
- in_transaction('non-ignored-transaction') do |txn|
746
- block_was_called = false
747
- txn.freeze_name_and_execute_if_not_ignored do
748
- block_was_called = true
749
- end
750
-
751
- assert block_was_called
752
- end
753
- end
754
-
755
- def test_freeze_name_and_execute_if_not_ignored_ignores_given_block_if_transaction_ignored
756
- NewRelic::Agent.instance.transaction_rules.expects(:rename).
757
- returns(nil)
758
- in_transaction('ignored-transaction') do |txn|
759
- block_was_called = false
760
- txn.freeze_name_and_execute_if_not_ignored do
761
- block_was_called = true
762
- end
763
-
764
- refute block_was_called
765
- end
766
- end
767
-
768
- def test_normal_cpu_burn_positive
769
- in_transaction do |txn|
770
- txn.instance_variable_set(:@process_cpu_start, 3)
771
- txn.stubs(:process_cpu).returns(4)
772
- assert_equal 1, txn.normal_cpu_burn
773
- end
774
- end
775
-
776
- def test_normal_cpu_burn_negative
777
- in_transaction do |txn|
778
- txn.instance_variable_set(:@process_cpu_start, nil)
779
- txn.expects(:process_cpu).never
780
- assert_equal nil, txn.normal_cpu_burn
781
- end
782
- end
783
-
784
- def test_jruby_cpu_burn_negative
785
- in_transaction do |txn|
786
- txn.instance_variable_set(:@jruby_cpu_start, nil)
787
- txn.expects(:jruby_cpu_time).never
788
- assert_equal nil, txn.jruby_cpu_burn
789
- end
790
- end
791
-
792
- module ::Java
793
- module JavaLangManagement
794
- class ManagementFactory
795
- end
796
- end
797
- end
798
-
799
- def test_jruby_cpu_time_returns_0_for_neg1_java_utime
800
- in_transaction do |txn|
801
- with_java_classes_loaded do
802
- bean = mock(:getCurrentThreadUserTime => -1)
803
- bean.stubs(:isCurrentThreadCpuTimeSupported).returns(true)
804
- ::Java::JavaLangManagement::ManagementFactory.stubs(:getThreadMXBean).returns(bean)
805
- assert_equal 0.0, txn.send(:jruby_cpu_time)
806
- end
807
- end
808
- end
809
-
810
- def test_jruby_cpu_time_returns_java_utime_over_1e9_if_java_utime_is_1
811
- java_utime = 1
812
- in_transaction do |txn|
813
- with_java_classes_loaded do
814
- bean = stub(:getCurrentThreadUserTime => java_utime)
815
- bean.stubs(:isCurrentThreadCpuTimeSupported).returns(true)
816
- ::Java::JavaLangManagement::ManagementFactory.stubs(:getThreadMXBean).returns(bean)
817
- assert_equal java_utime/1e9, txn.send(:jruby_cpu_time)
818
- end
819
- end
820
- end
821
-
822
- def test_jruby_cpu_time_logs_errors_once_at_warn
823
- in_transaction do |txn|
824
- with_java_classes_loaded do
825
- bean = mock
826
- bean.stubs(:isCurrentThreadCpuTimeSupported).returns(true)
827
- bean.stubs(:getCurrentThreadUserTime).raises(StandardError, 'Error calculating JRuby CPU Time')
828
- ::Java::JavaLangManagement::ManagementFactory.stubs(:getThreadMXBean).returns(bean)
829
-
830
- expects_logging(:warn, includes("Error calculating JRuby CPU Time"), any_parameters)
831
- txn.send(:jruby_cpu_time)
832
- expects_no_logging(:warn)
833
- txn.send(:jruby_cpu_time)
834
- end
835
- end
836
- end
837
-
838
- def test_jruby_cpu_time_always_logs_errors_at_debug
839
- in_transaction do |txn|
840
- with_java_classes_loaded do
841
- bean = mock
842
- bean.stubs(:isCurrentThreadCpuTimeSupported).returns(true)
843
- bean.stubs(:getCurrentThreadUserTime).raises(StandardError, 'Error calculating JRuby CPU Time')
844
- ::Java::JavaLangManagement::ManagementFactory.stubs(:getThreadMXBean).returns(bean)
845
-
846
- expects_logging(:warn, includes("Error calculating JRuby CPU Time"), any_parameters)
847
- txn.send(:jruby_cpu_time)
848
- expects_logging(:debug, includes("Error calculating JRuby CPU Time"), any_parameters)
849
- txn.send(:jruby_cpu_time)
850
- end
851
- end
852
- end
853
-
854
- def test_jruby_cpu_time_returns_nil_if_current_thread_user_time_raises
855
- in_transaction do |txn|
856
- with_java_classes_loaded do
857
- bean = mock
858
- bean.stubs(:isCurrentThreadCpuTimeSupported).returns(true)
859
- bean.stubs(:getCurrentThreadUserTime).raises(StandardError, 'Error calculating JRuby CPU Time')
860
- ::Java::JavaLangManagement::ManagementFactory.stubs(:getThreadMXBean).returns(bean)
861
-
862
- assert_nil txn.send(:jruby_cpu_time)
863
- end
864
- end
865
- end
866
-
867
- def test_jruby_cpu_time_does_not_call_get_current_thread_user_time_if_unsupported
868
- in_transaction do |txn|
869
- with_java_classes_loaded do
870
- bean = mock
871
- bean.stubs(:isCurrentThreadCpuTimeSupported).returns(false)
872
- ::Java::JavaLangManagement::ManagementFactory.stubs(:getThreadMXBean).returns(bean)
873
- bean.expects(:getCurrentThreadUserTime).never
874
-
875
- assert_nil txn.send(:jruby_cpu_time)
876
- end
877
- end
878
- end
879
-
880
- def with_java_classes_loaded
881
- ::NewRelic::Agent::Transaction.class_variable_set :@@java_classes_loaded, true
882
- yield
883
- ensure
884
- ::NewRelic::Agent::Transaction.class_variable_set :@@java_classes_loaded, false
885
- end
886
-
887
- def test_cpu_burn_normal
888
- in_transaction do |txn|
889
- txn.stubs(:normal_cpu_burn).returns(1)
890
- txn.expects(:jruby_cpu_burn).never
891
- assert_equal 1, txn.cpu_burn
892
- end
893
- end
894
-
895
- def test_cpu_burn_jruby
896
- in_transaction do |txn|
897
- txn.stubs(:normal_cpu_burn).returns(nil)
898
- txn.stubs(:jruby_cpu_burn).returns(2)
899
- assert_equal 2, txn.cpu_burn
900
- end
901
- end
902
-
903
- def test_transaction_takes_child_name_if_similar_category
904
- in_transaction('Controller/parent', :category => :sinatra) do
905
- in_transaction('Controller/child', :category => :controller) do
906
- end
907
- end
908
-
909
- assert_metrics_recorded(['Controller/child'])
910
- end
911
-
912
- def test_transaction_doesnt_take_child_name_if_different_category
913
- in_transaction('Controller/parent', :category => :sinatra) do
914
- in_transaction('Whatever/child', :category => :task) do
915
- end
916
- end
917
-
918
- assert_metrics_recorded(['Controller/parent'])
919
- end
920
-
921
- def test_transaction_should_take_child_name_if_frozen_early
922
- in_transaction('Controller/parent', :category => :sinatra) do
923
- in_transaction('Controller/child', :category => :controller) do |txn|
924
- txn.freeze_name_and_execute_if_not_ignored
925
- end
926
- end
927
-
928
- assert_metrics_recorded(['Controller/child'])
929
- end
930
-
931
- def test_ignored_returns_false_if_a_transaction_is_not_ignored
932
- in_transaction('Controller/test', :category => :sinatra) do |txn|
933
- refute txn.ignore?
934
- end
935
- end
936
-
937
- def test_ignored_returns_true_for_an_ignored_transaction
938
- in_transaction('Controller/test', :category => :sinatra) do |txn|
939
- txn.ignore!
940
- assert txn.ignore?
941
- end
942
- end
943
-
944
- def test_ignore_apdex_returns_true_if_apdex_is_ignored
945
- in_transaction('Controller/test', :category => :sinatra) do |txn|
946
- txn.ignore_apdex!
947
- assert txn.ignore_apdex?
948
- end
949
- end
950
-
951
- def test_ignore_apdex_returns_false_if_apdex_is_not_ignored
952
- in_transaction('Controller/test', :category => :sinatra) do |txn|
953
- refute txn.ignore_apdex?
954
- end
955
- end
956
-
957
- def test_ignore_enduser_returns_true_if_enduser_is_ignored
958
- in_transaction('Controller/test', :category => :sinatra) do |txn|
959
- txn.ignore_enduser!
960
- assert txn.ignore_enduser?
961
- end
962
- end
963
-
964
- def test_ignore_enduser_returns_false_if_enduser_is_not_ignored
965
- in_transaction('Controller/test', :category => :sinatra) do |txn|
966
- refute txn.ignore_enduser?
967
- end
968
- end
969
-
970
- def test_ignored_transactions_do_not_record_metrics
971
- in_transaction('Controller/test', :category => :sinatra) do |txn|
972
- txn.ignore!
973
- end
974
-
975
- assert_metrics_not_recorded(['Controller/test'])
976
- end
977
-
978
- def test_nested_transactions_are_ignored_if_nested_transaction_is_ignored
979
- in_transaction('Controller/parent', :category => :sinatra) do
980
- in_transaction('Controller/child', :category => :controller) do |txn|
981
- txn.ignore!
982
- end
983
- end
984
-
985
- assert_metrics_not_recorded(['Controller/sinatra', 'Controller/child'])
986
- end
987
-
988
- def test_nested_transactions_are_ignored_if_double_nested_transaction_is_ignored
989
- in_transaction('Controller/parent', :category => :sinatra) do
990
- in_transaction('Controller/toddler', :category => :controller) do
991
- in_transaction('Controller/infant', :category => :controller) do |txn|
992
- txn.ignore!
993
- end
994
- end
995
- end
996
-
997
- assert_metrics_not_recorded(['Controller/sinatra', 'Controller/toddler', 'Controller/infant'])
998
- end
999
-
1000
- def test_nested_other_transaction
1001
- in_transaction('OtherTransaction/outer', :category => :task) do
1002
- in_transaction('OtherTransaction/inner', :category => :task) do
1003
- end
1004
- end
1005
-
1006
- assert_metrics_recorded(['OtherTransaction/inner'])
1007
- assert_metrics_not_recorded(['OtherTransaction/outer'])
1008
- end
1009
-
1010
- def test_failure_during_ignore_error_filter_doesnt_prevent_transaction
1011
- filter = Proc.new do |*_|
1012
- raise "HAHAHAHAH, error in the filter for ignoring errors!"
1013
- end
1014
-
1015
- with_ignore_error_filter(filter) do
1016
- expects_logging(:error, includes("HAHAHAHAH"), any_parameters)
1017
-
1018
- in_transaction("Controller/boom") do
1019
- NewRelic::Agent::Transaction.notice_error(SillyError.new)
1020
- end
1021
-
1022
- assert_metrics_recorded('Controller/boom')
1023
- end
1024
- end
1025
-
1026
- def test_multiple_similar_errors_in_transaction_do_not_crash
1027
- error_class = Class.new(StandardError) do
1028
- def ==(other)
1029
- self.message == other.message
1030
- end
1031
- end
1032
-
1033
- in_transaction do |txn|
1034
- e0 = error_class.new('err')
1035
- e1 = error_class.new('err')
1036
- assert_equal(e0, e1)
1037
- txn.notice_error(e0)
1038
- txn.notice_error(e1)
1039
- end
1040
-
1041
- assert_metrics_recorded('Errors/all' => { :call_count => 2 })
1042
- end
1043
-
1044
- def test_start_safe_from_exceptions
1045
- NewRelic::Agent::Transaction.any_instance.stubs(:start).raises("Haha")
1046
- expects_logging(:error, any_parameters)
1047
-
1048
- in_transaction("Controller/boom") do
1049
- # nope
1050
- end
1051
-
1052
- # We expect our transaction to fail, but no exception should surface
1053
- assert_metrics_not_recorded(['Controller/boom'])
1054
- end
1055
-
1056
- def test_stop_safe_from_exceptions
1057
- NewRelic::Agent::Transaction.any_instance.stubs(:stop).raises("Haha")
1058
- expects_logging(:error, any_parameters)
1059
-
1060
- in_transaction("Controller/boom") do
1061
- # nope
1062
- end
1063
-
1064
- # We expect our transaction to fail, but no exception should surface
1065
- assert_metrics_not_recorded(['Controller/boom'])
1066
- end
1067
-
1068
- def test_stop_safe_when_no_transaction_available
1069
- expects_logging(:error, includes(NewRelic::Agent::Transaction::FAILED_TO_STOP_MESSAGE))
1070
-
1071
- state = NewRelic::Agent::TransactionState.new
1072
- NewRelic::Agent::Transaction.stop(state)
1073
- end
1074
-
1075
- def test_user_defined_rules_ignore_returns_true_for_matched_path
1076
- rule = 'ignored'
1077
- with_config(:rules => { :ignore_url_regexes => [rule] }) do
1078
- in_transaction do |txn|
1079
- txn.stubs(:request_path).returns(rule + '/path')
1080
- assert txn.user_defined_rules_ignore?, "Paths should be ignored based on user defined rules. Rule: '#{rule}', Path: '#{txn.request_path}'."
1081
- end
1082
- end
1083
- end
1084
-
1085
- def test_stop_ignores_transactions_from_ignored_paths
1086
- with_config(:rules => { :ignore_url_regexes => ['ignored/path'] }) do
1087
- in_transaction do |txn|
1088
- txn.stubs(:request_path).returns('ignored/path')
1089
- txn.expects(:ignore!)
1090
- end
1091
- end
1092
- end
1093
-
1094
- def test_user_defined_rules_ignore_returns_false_if_cannot_parse_uri
1095
- with_config(:rules => { :ignore_url_regexes => ['notempty'] }) do
1096
- in_transaction do |txn|
1097
- txn.stubs(:uri).returns('http://foo bar.com')
1098
- refute txn.user_defined_rules_ignore?
1099
- end
1100
- end
1101
- end
1102
-
1103
- def test_stop_resets_the_transaction_state_if_there_is_an_error
1104
- in_transaction do |txn|
1105
- state = mock
1106
- state.stubs(:current_transaction).raises(StandardError, 'StandardError')
1107
-
1108
- state.expects(:reset)
1109
- NewRelic::Agent::Transaction.stop(state)
1110
- end
1111
- end
1112
-
1113
- def test_doesnt_record_queue_time_if_it_is_zero
1114
- in_transaction('boo') do
1115
- # nothing
1116
- end
1117
- assert_metrics_not_recorded(['WebFrontend/QueueTime'])
1118
- end
1119
-
1120
- def test_doesnt_record_scoped_queue_time_metric
1121
- t0 = freeze_time
1122
- advance_time 10.0
1123
- in_transaction('boo', :apdex_start_time => t0) do
1124
- # nothing
1125
- end
1126
- assert_metrics_recorded('WebFrontend/QueueTime' => { :call_count => 1, :total_call_time => 10.0 })
1127
- assert_metrics_not_recorded(
1128
- [['WebFrontend/QueueTime', 'boo']]
1129
- )
1130
- end
1131
-
1132
- def test_doesnt_record_crazy_high_queue_times
1133
- t0 = freeze_time(Time.at(10.0))
1134
- advance_time(40 * 365 * 24 * 60 * 60) # 40 years
1135
- in_transaction('boo', :apdex_start_time => t0) do
1136
- # nothing
1137
- end
1138
- assert_metrics_not_recorded(['WebFrontend/QueueTime'])
1139
- end
1140
-
1141
- def test_background_transactions_with_ignore_rules_are_ok
1142
- with_config(:'rules.ignore_url_regexes' => ['foobar']) do
1143
- in_transaction('foo') do
1144
- end
1145
- end
1146
-
1147
- assert_metrics_recorded(['foo'])
1148
- end
1149
-
1150
- def test_transaction_start_sets_default_name_for_transactions_with_matching_categories
1151
- in_transaction('outside_cascade') do
1152
- in_transaction('inside_cascade') do |txn|
1153
- assert_equal 'inside_cascade', txn.best_name
1154
- end
1155
- end
1156
- end
1157
-
1158
- def test_similar_category?
1159
- web_category1 = NewRelic::Agent::Transaction::WEB_TRANSACTION_CATEGORIES.first
1160
- web_category2 = NewRelic::Agent::Transaction::WEB_TRANSACTION_CATEGORIES.last
1161
-
1162
- in_transaction('test', :category => web_category1) do |txn|
1163
- assert txn.similar_category?(web_category2)
1164
- end
1165
- end
1166
-
1167
- def test_similar_category_returns_false_with_mismatched_categories
1168
- web_category = NewRelic::Agent::Transaction::WEB_TRANSACTION_CATEGORIES.first
1169
-
1170
- in_transaction('test', :category => web_category) do |txn|
1171
- frame = stub(:category => :other)
1172
- refute txn.similar_category?(frame)
1173
- end
1174
- end
1175
-
1176
- def test_similar_category_returns_true_with_nonweb_categories
1177
- in_transaction('test', :category => :other) do |txn|
1178
- frame = stub(:category => :other)
1179
- assert txn.similar_category?(frame)
1180
- end
1181
- end
1182
-
1183
- def test_set_overriding_transaction_name_sets_name_from_api
1184
- in_transaction('test') do |txn|
1185
- txn.class.set_overriding_transaction_name('name_from_api', 'category')
1186
-
1187
- assert_equal 'category/name_from_api', txn.best_name
1188
- end
1189
- end
1190
-
1191
- def assert_has_custom_attribute(txn, key, value = key)
1192
- assert_equal(value, attributes_for(txn, :custom)[key])
1193
- end
1194
-
1195
- def test_wrap_transaction
1196
- state = NewRelic::Agent::TransactionState.tl_get
1197
- NewRelic::Agent::Transaction.wrap(state, 'test', :other) do
1198
- # No-op
1199
- end
1200
-
1201
- assert_metrics_recorded(['test'])
1202
- end
1203
-
1204
- def test_wrap_transaction_with_early_failure
1205
- yielded = false
1206
- state = NewRelic::Agent::TransactionState.tl_get
1207
- NewRelic::Agent::Transaction.any_instance.stubs(:start).raises("Boom")
1208
- NewRelic::Agent::Transaction.wrap(state, 'test', :other) do
1209
- yielded = true
1210
- end
1211
-
1212
- assert yielded
1213
- end
1214
-
1215
- def test_wrap_transaction_with_late_failure
1216
- state = NewRelic::Agent::TransactionState.tl_get
1217
- NewRelic::Agent::Transaction.any_instance.stubs(:stop).raises("Boom")
1218
- NewRelic::Agent::Transaction.wrap(state, 'test', :other) do
1219
- # No-op
1220
- end
1221
-
1222
- refute_metrics_recorded(['test'])
1223
- end
1224
-
1225
- def test_wrap_transaction_notices_errors
1226
- state = NewRelic::Agent::TransactionState.tl_get
1227
- assert_raises RuntimeError do
1228
- NewRelic::Agent::Transaction.wrap(state, 'test', :other) do
1229
- raise "O_o"
1230
- end
1231
- end
1232
-
1233
- assert_metrics_recorded(["Errors/all"])
1234
- end
1235
-
1236
- def test_instrumentation_state
1237
- in_transaction do |txn|
1238
- txn.instrumentation_state[:a] = 42
1239
- assert_equal(42, txn.instrumentation_state[:a])
1240
- end
1241
- end
1242
-
1243
- def test_adding_custom_attributes
1244
- with_config(:'transaction_tracer.attributes.enabled' => true) do
1245
- in_transaction do |txn|
1246
- NewRelic::Agent.add_custom_attributes(:foo => "bar")
1247
- actual = txn.attributes.custom_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1248
- assert_equal({"foo" => "bar"}, actual)
1249
- end
1250
- end
1251
- end
1252
-
1253
- def test_adding_agent_attributes
1254
- with_config(:'transaction_tracer.attributes.enabled' => true) do
1255
- in_transaction do |txn|
1256
- txn.add_agent_attribute(:foo, "bar", NewRelic::Agent::AttributeFilter::DST_ALL)
1257
- actual = txn.attributes.agent_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1258
- assert_equal({:foo => "bar"}, actual)
1259
- end
1260
- end
1261
- end
1262
-
1263
- def test_adding_agent_attributes_via_class
1264
- with_config(:'transaction_tracer.attributes.enabled' => true) do
1265
- in_transaction do |txn|
1266
- NewRelic::Agent::Transaction.add_agent_attribute(:foo, "bar", NewRelic::Agent::AttributeFilter::DST_ALL)
1267
- actual = txn.attributes.agent_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1268
- assert_equal({:foo => "bar"}, actual)
1269
- end
1270
- end
1271
- end
1272
-
1273
- def test_adding_agent_attributes_via_class_outside_of_txn_is_safe
1274
- expects_logging(:debug, includes("foo"))
1275
- NewRelic::Agent::Transaction.add_agent_attribute(:foo, "bar", NewRelic::Agent::AttributeFilter::DST_ALL)
1276
- end
1277
-
1278
- def test_adding_intrinsic_attributes
1279
- in_transaction do |txn|
1280
- txn.attributes.add_intrinsic_attribute(:foo, "bar")
1281
-
1282
- actual = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1283
- assert_equal({:foo => "bar"}, actual)
1284
- end
1285
- end
1286
-
1287
- def test_assigns_synthetics_to_intrinsic_attributes
1288
- txn = in_transaction do |t|
1289
- t.raw_synthetics_header = ""
1290
- t.synthetics_payload = [1, 1, 100, 200, 300]
1291
- t
1292
- end
1293
-
1294
- result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1295
- assert_equal 100, result[:synthetics_resource_id]
1296
- assert_equal 200, result[:synthetics_job_id]
1297
- assert_equal 300, result[:synthetics_monitor_id]
1298
- end
1299
-
1300
-
1301
- def test_intrinsic_attributes_include_gc_time
1302
- txn = in_transaction do |t|
1303
- NewRelic::Agent::StatsEngine::GCProfiler.stubs(:record_delta).returns(10.0)
1304
- end
1305
-
1306
- result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1307
- assert_equal 10.0, result[:gc_time]
1308
- end
1309
-
1310
- def test_intrinsic_attributes_include_tripid
1311
- guid = nil
1312
-
1313
- NewRelic::Agent.instance.cross_app_monitor.stubs(:client_referring_transaction_trip_id).returns('PDX-NRT')
1314
-
1315
- txn = in_transaction do |t|
1316
- NewRelic::Agent::TransactionState.tl_get.is_cross_app_caller = true
1317
- guid = t.guid
1318
- end
1319
-
1320
- result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1321
- assert_equal 'PDX-NRT', result[:trip_id]
1322
- end
1323
-
1324
- def test_intrinsic_attributes_dont_include_tripid_if_not_cross_app_transaction
1325
- NewRelic::Agent.instance.cross_app_monitor.stubs(:client_referring_transaction_trip_id).returns('PDX-NRT')
1326
-
1327
- txn = in_transaction do
1328
- NewRelic::Agent::TransactionState.tl_get.is_cross_app_caller = false
1329
- end
1330
-
1331
- result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1332
- assert_nil result[:trip_id]
1333
- end
1334
-
1335
- def test_intrinsic_attributes_include_path_hash
1336
- path_hash = nil
1337
-
1338
- txn = in_transaction do |t|
1339
- state = NewRelic::Agent::TransactionState.tl_get
1340
- state.is_cross_app_caller = true
1341
- path_hash = t.cat_path_hash(state)
1342
- end
1343
-
1344
- result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1345
- assert_equal path_hash, result[:path_hash]
1346
- end
1347
-
1348
- def test_synthetics_attributes_not_included_if_not_valid_synthetics_request
1349
- txn = in_transaction do |t|
1350
- t.raw_synthetics_header = nil
1351
- t.synthetics_payload = nil
1352
- end
1353
-
1354
- result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1355
- assert_nil result[:synthetics_resource_id]
1356
- assert_nil result[:synthetics_job_id]
1357
- assert_nil result[:synthetics_monitor_id]
1358
- end
1359
-
1360
- def test_intrinsic_attributes_include_cpu_time
1361
- txn = in_transaction do |t|
1362
- t.stubs(:cpu_burn).returns(22.0)
1363
- end
1364
-
1365
- result = txn.attributes.intrinsic_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1366
- assert_equal 22.0, result[:cpu_time]
1367
- end
1368
-
1369
- def test_request_params_included_in_agent_attributes
1370
- txn = with_config(:capture_params => true) do
1371
- in_transaction(:filtered_params => {:foo => "bar"}) do
1372
- end
1373
- end
1374
-
1375
- actual = txn.attributes.agent_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1376
- assert_equal "bar", actual['request.parameters.foo']
1377
- end
1378
-
1379
- def test_request_params_included_in_agent_attributes_in_nested_txn
1380
- txn = with_config(:capture_params => true) do
1381
- in_transaction(:filtered_params => {:foo => "bar", :bar => "baz"}) do
1382
- in_transaction(:filtered_params => {:bar => "qux"}) do
1383
- end
1384
- end
1385
- end
1386
-
1387
- actual = txn.attributes.agent_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1388
- assert_equal "bar", actual['request.parameters.foo']
1389
- assert_equal "qux", actual['request.parameters.bar']
1390
- end
1391
-
1392
- def test_request_params_get_key_length_limits
1393
- key = "x" * 1000
1394
- expects_logging(:debug, includes(key))
1395
-
1396
- txn = with_config(:capture_params => true) do
1397
- in_transaction(:filtered_params => {key => "bar"}) do
1398
- end
1399
- end
1400
-
1401
- actual = txn.attributes.agent_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1402
- assert_empty actual
1403
- end
1404
-
1405
- def test_http_response_code_included_in_agent_attributes
1406
- txn = in_transaction do |t|
1407
- t.http_response_code = 418
1408
- end
1409
-
1410
- actual = txn.attributes.agent_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1411
- assert_equal "418", actual[:"httpResponseCode"]
1412
- end
1413
-
1414
- def test_referer_in_agent_attributes
1415
- request = stub('request', :referer => "/referered", :path => "/")
1416
- txn = in_transaction(:request => request) do
1417
- end
1418
-
1419
- actual = txn.attributes.agent_attributes_for(NewRelic::Agent::AttributeFilter::DST_ERROR_COLLECTOR)
1420
- assert_equal "/referered", actual[:'request.headers.referer']
1421
- end
1422
-
1423
- def test_referer_omitted_if_not_on_request
1424
- request = stub('request', :path => "/")
1425
- txn = in_transaction(:request => request) do
1426
- end
1427
-
1428
- actual = txn.attributes.agent_attributes_for(NewRelic::Agent::AttributeFilter::DST_TRANSACTION_TRACER)
1429
- refute_includes actual, :'request.headers.referer'
1430
- end
1431
-
1432
- def test_error_recorded_predicate_false_by_default
1433
- txn = in_transaction do
1434
- end
1435
-
1436
- refute txn.payload[:error], "Did not expected error to be recorded"
1437
- end
1438
-
1439
- def test_error_recorded_predicate_true_when_error_recorded
1440
- txn = in_transaction do |t|
1441
- t.notice_error StandardError.new "Sorry!"
1442
- end
1443
-
1444
- assert txn.payload[:error], "Expected error to be recorded"
1445
- end
1446
-
1447
- def test_error_recorded_predicate_abides_by_ignore_filter
1448
- filter = Proc.new do |error|
1449
- error.message == "Sorry!" ? nil : error
1450
- end
1451
-
1452
- with_ignore_error_filter filter do
1453
- txn = in_transaction do |t|
1454
- t.notice_error StandardError.new "Sorry!"
1455
- end
1456
-
1457
- refute txn.payload[:error], "Expected error to be apologetic"
1458
- end
1459
- end
1460
-
1461
- def test_error_recorded_with_ignore_filter_and_multiple_errors
1462
- filter = Proc.new do |error|
1463
- error.message == "Sorry!" ? nil : error
1464
- end
1465
-
1466
- with_ignore_error_filter filter do
1467
- txn = in_transaction do |t|
1468
- t.notice_error StandardError.new "Sorry!"
1469
- t.notice_error StandardError.new "Not Sorry!"
1470
- t.notice_error StandardError.new "Sorry!"
1471
- end
1472
-
1473
- assert txn.payload[:error], "Expected error to be recorded"
1474
- end
1475
- end
1476
- end