logstash-output-scalyr 0.1.8 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -0
  3. data/Gemfile +5 -0
  4. data/README.md +3 -2
  5. data/lib/logstash/outputs/scalyr.rb +226 -138
  6. data/lib/scalyr/common/client.rb +76 -50
  7. data/lib/scalyr/common/util.rb +7 -0
  8. data/lib/scalyr/constants.rb +2 -0
  9. data/logstash-output-scalyr.gemspec +1 -1
  10. data/spec/logstash/outputs/scalyr_integration_spec.rb +148 -8
  11. data/spec/logstash/outputs/scalyr_spec.rb +12 -6
  12. data/vendor/bundle/jruby/2.5.0/bin/htmldiff +1 -1
  13. data/vendor/bundle/jruby/2.5.0/bin/ldiff +1 -1
  14. data/vendor/bundle/jruby/2.5.0/cache/addressable-2.7.0.gem +0 -0
  15. data/vendor/bundle/jruby/2.5.0/cache/crack-0.4.5.gem +0 -0
  16. data/vendor/bundle/jruby/2.5.0/cache/hashdiff-1.0.1.gem +0 -0
  17. data/vendor/bundle/jruby/2.5.0/cache/public_suffix-4.0.6.gem +0 -0
  18. data/vendor/bundle/jruby/2.5.0/cache/rexml-3.2.5.gem +0 -0
  19. data/vendor/bundle/jruby/2.5.0/cache/webmock-3.13.0.gem +0 -0
  20. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/CHANGELOG.md +235 -0
  21. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/Gemfile +32 -0
  22. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/LICENSE.txt +202 -0
  23. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/README.md +121 -0
  24. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/Rakefile +34 -0
  25. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/data/unicode.data +0 -0
  26. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable.rb +4 -0
  27. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna.rb +27 -0
  28. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna/native.rb +61 -0
  29. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna/pure.rb +676 -0
  30. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/template.rb +1045 -0
  31. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/uri.rb +2529 -0
  32. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/version.rb +32 -0
  33. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/idna_spec.rb +300 -0
  34. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/net_http_compat_spec.rb +30 -0
  35. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/rack_mount_compat_spec.rb +106 -0
  36. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/security_spec.rb +59 -0
  37. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/template_spec.rb +1451 -0
  38. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/uri_spec.rb +6603 -0
  39. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/spec_helper.rb +24 -0
  40. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/clobber.rake +4 -0
  41. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/gem.rake +93 -0
  42. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/git.rake +47 -0
  43. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/metrics.rake +24 -0
  44. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/rspec.rake +23 -0
  45. data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/yard.rake +29 -0
  46. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack.rb +7 -0
  47. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/json.rb +98 -0
  48. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/util.rb +17 -0
  49. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/version.rb +3 -0
  50. data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/xml.rb +238 -0
  51. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/Gemfile +8 -0
  52. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/LICENSE +19 -0
  53. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/README.md +276 -0
  54. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/Rakefile +18 -0
  55. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/changelog.md +100 -0
  56. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/hashdiff.gemspec +39 -0
  57. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff.rb +10 -0
  58. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/compare_hashes.rb +69 -0
  59. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/diff.rb +177 -0
  60. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/lcs.rb +66 -0
  61. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
  62. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/linear_compare_array.rb +159 -0
  63. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/patch.rb +88 -0
  64. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/util.rb +155 -0
  65. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/version.rb +5 -0
  66. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/best_diff_spec.rb +75 -0
  67. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/diff_array_spec.rb +60 -0
  68. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/diff_spec.rb +360 -0
  69. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/lcs_spec.rb +76 -0
  70. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/linear_compare_array_spec.rb +50 -0
  71. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/patch_spec.rb +185 -0
  72. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/readme_spec.rb +15 -0
  73. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/util_spec.rb +116 -0
  74. data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/spec_helper.rb +15 -0
  75. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/2.0-Upgrade.md +52 -0
  76. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/CHANGELOG.md +406 -0
  77. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/Gemfile +15 -0
  78. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/LICENSE.txt +22 -0
  79. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/README.md +207 -0
  80. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/Rakefile +51 -0
  81. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/SECURITY.md +104 -0
  82. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/bin/console +15 -0
  83. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/codecov.yml +12 -0
  84. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/data/list.txt +13380 -0
  85. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix.rb +179 -0
  86. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/domain.rb +235 -0
  87. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/errors.rb +41 -0
  88. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/list.rb +247 -0
  89. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/rule.rb +350 -0
  90. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/version.rb +13 -0
  91. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/public_suffix.gemspec +29 -0
  92. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/acceptance_test.rb +131 -0
  93. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_find.rb +66 -0
  94. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_find_all.rb +102 -0
  95. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_names.rb +91 -0
  96. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_select.rb +26 -0
  97. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_select_incremental.rb +25 -0
  98. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_valid.rb +101 -0
  99. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/domain_profiler.rb +12 -0
  100. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/find_profiler.rb +12 -0
  101. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/find_profiler_jp.rb +12 -0
  102. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/initialization_profiler.rb +11 -0
  103. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/list_profsize.rb +11 -0
  104. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/object_binsize.rb +57 -0
  105. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/psl_test.rb +52 -0
  106. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/test_helper.rb +18 -0
  107. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/tests.txt +98 -0
  108. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/domain_test.rb +106 -0
  109. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/errors_test.rb +25 -0
  110. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/list_test.rb +241 -0
  111. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/public_suffix_test.rb +188 -0
  112. data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/rule_test.rb +222 -0
  113. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/LICENSE.txt +22 -0
  114. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/NEWS.md +178 -0
  115. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/README.md +48 -0
  116. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/context.rdoc +143 -0
  117. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/child.rdoc +87 -0
  118. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/document.rdoc +276 -0
  119. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/element.rdoc +602 -0
  120. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/node.rdoc +97 -0
  121. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
  122. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
  123. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
  124. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
  125. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
  126. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
  127. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
  128. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml.rb +3 -0
  129. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/attlistdecl.rb +63 -0
  130. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/attribute.rb +205 -0
  131. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/cdata.rb +68 -0
  132. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/child.rb +97 -0
  133. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/comment.rb +80 -0
  134. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/doctype.rb +311 -0
  135. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/document.rb +451 -0
  136. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/attlistdecl.rb +11 -0
  137. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/dtd.rb +47 -0
  138. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/elementdecl.rb +18 -0
  139. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/entitydecl.rb +57 -0
  140. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/notationdecl.rb +40 -0
  141. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/element.rb +2599 -0
  142. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/encoding.rb +51 -0
  143. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/entity.rb +171 -0
  144. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/default.rb +116 -0
  145. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +142 -0
  146. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/transitive.rb +58 -0
  147. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/functions.rb +447 -0
  148. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/instruction.rb +79 -0
  149. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/light/node.rb +188 -0
  150. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/namespace.rb +59 -0
  151. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/node.rb +76 -0
  152. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/output.rb +30 -0
  153. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parent.rb +166 -0
  154. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parseexception.rb +52 -0
  155. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +694 -0
  156. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/lightparser.rb +59 -0
  157. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +197 -0
  158. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +273 -0
  159. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +61 -0
  160. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +101 -0
  161. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/ultralightparser.rb +57 -0
  162. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +689 -0
  163. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/quickpath.rb +266 -0
  164. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/rexml.rb +37 -0
  165. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/sax2listener.rb +98 -0
  166. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/security.rb +28 -0
  167. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/source.rb +298 -0
  168. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/streamlistener.rb +93 -0
  169. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/text.rb +424 -0
  170. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/undefinednamespaceexception.rb +9 -0
  171. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +539 -0
  172. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +144 -0
  173. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/validationexception.rb +10 -0
  174. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb +130 -0
  175. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb +85 -0
  176. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xpath.rb +81 -0
  177. data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +974 -0
  178. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/CHANGELOG.md +1894 -0
  179. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/Gemfile +9 -0
  180. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/LICENSE +20 -0
  181. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/README.md +1176 -0
  182. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/Rakefile +38 -0
  183. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock.rb +59 -0
  184. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/api.rb +109 -0
  185. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/assertion_failure.rb +11 -0
  186. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/callback_registry.rb +35 -0
  187. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/config.rb +18 -0
  188. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/cucumber.rb +10 -0
  189. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/deprecation.rb +9 -0
  190. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/errors.rb +17 -0
  191. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +216 -0
  192. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/curb_adapter.rb +351 -0
  193. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +231 -0
  194. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/excon_adapter.rb +165 -0
  195. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_lib_adapter.rb +7 -0
  196. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +19 -0
  197. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
  198. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/request.rb +16 -0
  199. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/response.rb +64 -0
  200. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/streamer.rb +29 -0
  201. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/webmock.rb +68 -0
  202. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb_adapter.rb +37 -0
  203. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/httpclient_adapter.rb +259 -0
  204. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/manticore_adapter.rb +145 -0
  205. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/net_http.rb +385 -0
  206. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/net_http_response.rb +34 -0
  207. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/patron_adapter.rb +130 -0
  208. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +174 -0
  209. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/any_arg_matcher.rb +13 -0
  210. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb +21 -0
  211. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_excluding_matcher.rb +15 -0
  212. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_including_matcher.rb +17 -0
  213. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb +41 -0
  214. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rack_response.rb +69 -0
  215. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_body_diff.rb +64 -0
  216. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_execution_verifier.rb +77 -0
  217. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_pattern.rb +405 -0
  218. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_registry.rb +35 -0
  219. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_signature.rb +54 -0
  220. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_signature_snippet.rb +61 -0
  221. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_stub.rb +100 -0
  222. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/response.rb +159 -0
  223. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/responses_sequence.rb +40 -0
  224. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec.rb +42 -0
  225. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers.rb +27 -0
  226. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/request_pattern_matcher.rb +78 -0
  227. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb +67 -0
  228. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/stub_registry.rb +82 -0
  229. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/stub_request_snippet.rb +38 -0
  230. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/test_unit.rb +20 -0
  231. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_counter.rb +39 -0
  232. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_keys_stringifier.rb +25 -0
  233. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_validator.rb +17 -0
  234. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/headers.rb +64 -0
  235. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/json.rb +67 -0
  236. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/query_mapper.rb +281 -0
  237. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/uri.rb +111 -0
  238. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/values_stringifier.rb +20 -0
  239. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/version_checker.rb +111 -0
  240. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/version.rb +3 -0
  241. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/webmock.rb +163 -0
  242. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/test_helper.rb +34 -0
  243. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/test_webmock.rb +9 -0
  244. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/webmock_spec.rb +60 -0
  245. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/async_http_client/async_http_client_spec.rb +375 -0
  246. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/async_http_client/async_http_client_spec_helper.rb +73 -0
  247. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/curb/curb_spec.rb +499 -0
  248. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/curb/curb_spec_helper.rb +147 -0
  249. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/em_http_request/em_http_request_spec.rb +462 -0
  250. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +77 -0
  251. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/excon/excon_spec.rb +77 -0
  252. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/excon/excon_spec_helper.rb +52 -0
  253. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/http_rb/http_rb_spec.rb +93 -0
  254. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/http_rb/http_rb_spec_helper.rb +54 -0
  255. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/httpclient/httpclient_spec.rb +217 -0
  256. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/httpclient/httpclient_spec_helper.rb +57 -0
  257. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/manticore/manticore_spec.rb +107 -0
  258. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/manticore/manticore_spec_helper.rb +35 -0
  259. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_shared.rb +153 -0
  260. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_spec.rb +369 -0
  261. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_spec_helper.rb +64 -0
  262. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/real_net_http_spec.rb +20 -0
  263. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/patron/patron_spec.rb +125 -0
  264. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/patron/patron_spec_helper.rb +54 -0
  265. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +313 -0
  266. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/callbacks.rb +148 -0
  267. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/complex_cross_concern_behaviors.rb +36 -0
  268. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/enabling_and_disabling_webmock.rb +95 -0
  269. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/precedence_of_stubs.rb +15 -0
  270. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/request_expectations.rb +930 -0
  271. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/returning_declared_responses.rb +409 -0
  272. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/stubbing_requests.rb +678 -0
  273. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +135 -0
  274. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +60 -0
  275. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/webmock_shared.rb +41 -0
  276. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/fixtures/test.txt +1 -0
  277. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/quality_spec.rb +84 -0
  278. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/spec_helper.rb +48 -0
  279. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/example_curl_output.txt +22 -0
  280. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/failures.rb +9 -0
  281. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/my_rack_app.rb +53 -0
  282. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/network_connection.rb +19 -0
  283. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/webmock_server.rb +70 -0
  284. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/api_spec.rb +175 -0
  285. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/errors_spec.rb +129 -0
  286. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +17 -0
  287. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +12 -0
  288. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/matchers/hash_excluding_matcher_spec.rb +61 -0
  289. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/matchers/hash_including_matcher_spec.rb +87 -0
  290. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/rack_response_spec.rb +112 -0
  291. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_body_diff_spec.rb +90 -0
  292. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_execution_verifier_spec.rb +208 -0
  293. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_pattern_spec.rb +736 -0
  294. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_registry_spec.rb +95 -0
  295. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_signature_snippet_spec.rb +89 -0
  296. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_signature_spec.rb +155 -0
  297. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_stub_spec.rb +199 -0
  298. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/response_spec.rb +286 -0
  299. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/stub_registry_spec.rb +103 -0
  300. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/stub_request_snippet_spec.rb +115 -0
  301. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/hash_counter_spec.rb +39 -0
  302. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/hash_keys_stringifier_spec.rb +27 -0
  303. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/headers_spec.rb +28 -0
  304. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/json_spec.rb +33 -0
  305. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/query_mapper_spec.rb +157 -0
  306. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/uri_spec.rb +371 -0
  307. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/version_checker_spec.rb +65 -0
  308. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/webmock_spec.rb +60 -0
  309. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/http_request.rb +24 -0
  310. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/shared_test.rb +108 -0
  311. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/test_helper.rb +23 -0
  312. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/test_webmock.rb +12 -0
  313. data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/webmock.gemspec +54 -0
  314. data/vendor/bundle/jruby/2.5.0/specifications/addressable-2.7.0.gemspec +39 -0
  315. data/vendor/bundle/jruby/2.5.0/specifications/crack-0.4.5.gemspec +32 -0
  316. data/vendor/bundle/jruby/2.5.0/specifications/hashdiff-1.0.1.gemspec +46 -0
  317. data/vendor/bundle/jruby/2.5.0/specifications/public_suffix-4.0.6.gemspec +24 -0
  318. data/vendor/bundle/jruby/2.5.0/specifications/rexml-3.2.5.gemspec +42 -0
  319. data/vendor/bundle/jruby/2.5.0/specifications/webmock-3.13.0.gemspec +85 -0
  320. metadata +309 -2
@@ -1,3 +1,5 @@
1
+ require "scalyr/constants"
2
+
1
3
  module Scalyr; module Common; module Client
2
4
 
3
5
  #---------------------------------------------------------------------------------------------------------------------
@@ -52,8 +54,9 @@ end
52
54
  class ClientSession
53
55
 
54
56
  def initialize(logger, add_events_uri, compression_type, compression_level,
55
- ssl_verify_peer, ssl_ca_bundle_path, ssl_verify_depth, append_builtin_cert,
56
- record_stats_for_status, flush_quantile_estimates_on_status_send)
57
+ ssl_verify_peer, ssl_ca_bundle_path, append_builtin_cert,
58
+ record_stats_for_status, flush_quantile_estimates_on_status_send,
59
+ connect_timeout, socket_timeout, request_timeout, pool_max, pool_max_per_route)
57
60
  @logger = logger
58
61
  @add_events_uri = add_events_uri # typically /addEvents
59
62
  @compression_type = compression_type
@@ -61,9 +64,13 @@ class ClientSession
61
64
  @ssl_verify_peer = ssl_verify_peer
62
65
  @ssl_ca_bundle_path = ssl_ca_bundle_path
63
66
  @append_builtin_cert = append_builtin_cert
64
- @ssl_verify_depth = ssl_verify_depth
65
67
  @record_stats_for_status = record_stats_for_status
66
68
  @flush_quantile_estimates_on_status_send = flush_quantile_estimates_on_status_send
69
+ @connect_timeout = connect_timeout
70
+ @socket_timeout = socket_timeout
71
+ @request_timeout = request_timeout
72
+ @pool_max = pool_max
73
+ @pool_max_per_route = pool_max_per_route
67
74
 
68
75
  # A cert to use by default to avoid issues caused by the OpenSSL library not validating certs according to standard
69
76
  @cert_string = "" \
@@ -126,11 +133,29 @@ class ClientSession
126
133
  :compression_type => @compression_type,
127
134
  :compression_level => @compression_level,
128
135
  }
136
+ end # def initialize
129
137
 
130
- @http = Net::HTTP::Persistent.new
138
+ def client_config
139
+ # TODO: Eventually expose some more of these as config options, though nothing here really needs tuning normally
140
+ # besides SSL
141
+ c = {
142
+ connect_timeout: @connect_timeout,
143
+ socket_timeout: @socket_timeout,
144
+ request_timeout: @request_timeout,
145
+ follow_redirects: true,
146
+ automatic_retries: 1,
147
+ retry_non_idempotent: false,
148
+ check_connection_timeout: 200,
149
+ pool_max: @pool_max,
150
+ pool_max_per_route: @pool_max_per_route,
151
+ cookies: true,
152
+ keepalive: true,
153
+ ssl: {}
154
+ }
131
155
 
132
156
  # verify peers to prevent potential MITM attacks
133
157
  if @ssl_verify_peer
158
+ c[:ssl][:verify] = :strict
134
159
  @ca_cert = Tempfile.new("ca_cert")
135
160
  if File.file?(@ssl_ca_bundle_path)
136
161
  @ca_cert.write(File.read(@ssl_ca_bundle_path))
@@ -142,13 +167,17 @@ class ClientSession
142
167
  end
143
168
  end
144
169
  @ca_cert.flush
145
- @http.ca_file = @ca_cert.path
146
- @http.verify_mode = OpenSSL::SSL::VERIFY_PEER
147
- @http.verify_depth = @ssl_verify_depth
170
+ c[:ssl][:ca_file] = @ca_cert.path
148
171
  else
149
- @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
172
+ c[:ssl][:verify] = :disable
150
173
  end
151
- end # def initialize
174
+
175
+ c
176
+ end
177
+
178
+ def client
179
+ @client ||= Manticore::Client.new(client_config)
180
+ end
152
181
 
153
182
  # Convenience method to create a fresh quantile estimator
154
183
  def get_new_latency_stats
@@ -163,60 +192,56 @@ class ClientSession
163
192
 
164
193
  # Get a clone of current statistics hash and calculate percentiles
165
194
  def get_stats
166
- current_stats = @stats.clone
167
-
168
- current_stats[:request_latency_p50] = @latency_stats[:request_latency_secs].query(0.5)
169
- current_stats[:request_latency_p90] = @latency_stats[:request_latency_secs].query(0.9)
170
- current_stats[:request_latency_p99] = @latency_stats[:request_latency_secs].query(0.99)
171
- current_stats[:serialization_duration_secs_p50] = @latency_stats[:serialization_duration_secs].query(0.5)
172
- current_stats[:serialization_duration_secs_p90] = @latency_stats[:serialization_duration_secs].query(0.9)
173
- current_stats[:serialization_duration_secs_p99] = @latency_stats[:serialization_duration_secs].query(0.99)
174
- current_stats[:compression_duration_secs_p50] = @latency_stats[:compression_duration_secs].query(0.5)
175
- current_stats[:compression_duration_secs_p90] = @latency_stats[:compression_duration_secs].query(0.9)
176
- current_stats[:compression_duration_secs_p99] = @latency_stats[:compression_duration_secs].query(0.99)
177
- current_stats[:bytes_sent_p50] = @latency_stats[:bytes_sent].query(0.5)
178
- current_stats[:bytes_sent_p90] = @latency_stats[:bytes_sent].query(0.9)
179
- current_stats[:bytes_sent_p99] = @latency_stats[:bytes_sent].query(0.99)
180
-
181
- if @flush_quantile_estimates_on_status_send
182
- @logger.debug "Recreating / reseting quantile estimator classes for plugin metrics"
183
- @latency_stats = get_new_latency_stats
195
+ @stats_lock.synchronize do
196
+ current_stats = @stats.clone
197
+
198
+ current_stats[:request_latency_p50] = @latency_stats[:request_latency_secs].query(0.5)
199
+ current_stats[:request_latency_p90] = @latency_stats[:request_latency_secs].query(0.9)
200
+ current_stats[:request_latency_p99] = @latency_stats[:request_latency_secs].query(0.99)
201
+ current_stats[:serialization_duration_secs_p50] = @latency_stats[:serialization_duration_secs].query(0.5)
202
+ current_stats[:serialization_duration_secs_p90] = @latency_stats[:serialization_duration_secs].query(0.9)
203
+ current_stats[:serialization_duration_secs_p99] = @latency_stats[:serialization_duration_secs].query(0.99)
204
+ current_stats[:compression_duration_secs_p50] = @latency_stats[:compression_duration_secs].query(0.5)
205
+ current_stats[:compression_duration_secs_p90] = @latency_stats[:compression_duration_secs].query(0.9)
206
+ current_stats[:compression_duration_secs_p99] = @latency_stats[:compression_duration_secs].query(0.99)
207
+ current_stats[:bytes_sent_p50] = @latency_stats[:bytes_sent].query(0.5)
208
+ current_stats[:bytes_sent_p90] = @latency_stats[:bytes_sent].query(0.9)
209
+ current_stats[:bytes_sent_p99] = @latency_stats[:bytes_sent].query(0.99)
210
+
211
+ if @flush_quantile_estimates_on_status_send
212
+ @logger.debug "Recreating / reseting quantile estimator classes for plugin metrics"
213
+ @latency_stats = get_new_latency_stats
214
+ end
215
+ current_stats
184
216
  end
185
- current_stats
186
217
  end
187
218
 
188
219
 
189
220
 
190
221
  # Upload data to Scalyr. Assumes that the body size complies with Scalyr limits
191
222
  def post_add_events(body, is_status, body_serialization_duration = 0)
192
- post, compression_duration = prepare_post_object @add_events_uri.path, body
223
+ post_body, post_headers, compression_duration = prepare_post_object @add_events_uri.path, body
193
224
  fail_count = 1 # putative assume failure
194
225
  start_time = Time.now
195
226
  uncompressed_bytes_sent = 0
196
227
  compressed_bytes_sent = 0
197
228
  bytes_received = 0
198
229
  begin
199
- response = @http.request(@add_events_uri, post)
230
+ response = client.send(:post, @add_events_uri, body: post_body, headers: post_headers)
200
231
  handle_response(response)
201
232
 
202
233
  fail_count -= 1 # success means we negate the putative failure
203
234
  uncompressed_bytes_sent = (body.bytesize + @add_events_uri.path.bytesize)
204
- compressed_bytes_sent = (post.body.bytesize + @add_events_uri.path.bytesize)
235
+ compressed_bytes_sent = (post_body.bytesize + @add_events_uri.path.bytesize)
205
236
  bytes_received = response.body.bytesize # echee: double check
206
237
  # echee TODO add more statistics
207
238
 
239
+ # TODO: Manticore doesn't raise SSL errors as this but as "UnknownExceptions", need to dig in and see if there is a
240
+ # way to detect that it is from SSL.
208
241
  rescue OpenSSL::SSL::SSLError => e
209
- if @ssl_verify_peer and @ssl_ca_bundle_path.nil? and !File.file?(@ca_cert.path)
210
- @ca_cert = Tempfile.new("ca_cert")
211
- @ca_cert.write(@cert_string)
212
- @ca_cert.flush
213
- @http.ca_file = @ca_cert.path
214
- raise ClientError.new("Packaged certificate appears to have been deleted, writing a new one.", @add_events_uri)
215
- else
216
- raise e
217
- end
242
+ raise e
218
243
 
219
- rescue Net::HTTP::Persistent::Error => e
244
+ rescue Manticore::ManticoreException => e
220
245
  # The underlying persistent-connection library automatically retries when there are network-related errors.
221
246
  # Eventually, it will give up and raise this generic error, at which time, we convert it to a ClientError
222
247
  raise ClientError.new(e.message, @add_events_uri)
@@ -245,7 +270,6 @@ class ClientSession
245
270
 
246
271
 
247
272
  def close
248
- @http.shutdown
249
273
  end # def close
250
274
 
251
275
 
@@ -273,18 +297,20 @@ class ClientSession
273
297
  compression_duration = end_time - start_time
274
298
  end
275
299
 
276
- post = Net::HTTP::Post.new uri_path
277
- post.add_field('Content-Type', 'application/json')
278
- version = 'output-logstash-scalyr 0.1.8'
279
- post.add_field('User-Agent', version + ';' + RUBY_VERSION + ';' + RUBY_PLATFORM)
300
+ version = sprintf('output-logstash-scalyr %s' % [PLUGIN_VERSION])
301
+ post_headers = {
302
+ 'Content-Type': 'application/json',
303
+ 'User-Agent': version + ';' + RUBY_VERSION + ';' + RUBY_PLATFORM
304
+ }
280
305
 
306
+ post_body = nil
281
307
  if not encoding.nil?
282
- post.add_field('Content-Encoding', encoding)
283
- post.body = compressed_body
308
+ post_headers['Content-Encoding'] = encoding
309
+ post_body = compressed_body
284
310
  else
285
- post.body = body
311
+ post_body = body
286
312
  end
287
- return post, compression_duration
313
+ return post_body, post_headers, compression_duration
288
314
  end # def prepare_post_object
289
315
 
290
316
 
@@ -45,5 +45,12 @@ def self.flatten(obj, delimiter='_')
45
45
  return result
46
46
  end
47
47
 
48
+ def self.truncate(content, max)
49
+ if content.length > max
50
+ return "#{content[0...(max-3)]}..."
51
+ end
52
+ return content
53
+ end
54
+
48
55
  end; end; end;
49
56
 
@@ -0,0 +1,2 @@
1
+ # encoding: utf-8
2
+ PLUGIN_VERSION = "v0.1.13"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-scalyr'
3
- s.version = '0.1.8'
3
+ s.version = '0.1.13'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "Scalyr output plugin for Logstash"
6
6
  s.description = "Sends log data collected by Logstash to Scalyr (https://www.scalyr.com)"
@@ -4,27 +4,63 @@ require "logstash/outputs/scalyr"
4
4
  require "logstash/codecs/plain"
5
5
  require "logstash/event"
6
6
  require "json"
7
+ require 'webmock/rspec'
8
+ WebMock.allow_net_connect!
7
9
 
8
10
  describe LogStash::Outputs::Scalyr do
11
+ let(:sample_events) {
12
+ events = []
13
+ for i in 1..3 do
14
+ e = LogStash::Event.new
15
+ e.set('source_host', "my host #{i}")
16
+ e.set('source_file', "my file #{i}")
17
+ e.set('seq', i)
18
+ e.set('nested', {'a'=>1, 'b'=>[3,4,5]})
19
+ e.set('tags', ['t1', 't2', 't3'])
20
+ events.push(e)
21
+ end
22
+ events
23
+ }
9
24
 
10
25
  describe "#ssl_tests" do
11
26
  context "with default SSL configuration" do
12
27
  it "throws a ServerError due to fake api key" do
13
- expect {
14
28
  plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234'})
15
29
  plugin.register
30
+ plugin.instance_variable_set(:@running, false)
31
+ expect(plugin.instance_variable_get(:@logger)).to receive(:error).with("Error uploading to Scalyr (will backoff-retry)",
32
+ {
33
+ :batch_num=>1,
34
+ :code=>401,
35
+ :message=>"error/client/badParam",
36
+ :payload_size=>781,
37
+ :record_count=>3,
38
+ :total_batches=>1,
39
+ :url=>"https://agent.scalyr.com/addEvents",
40
+ :will_retry_in_seconds=>2
41
+ }
42
+ )
16
43
  plugin.multi_receive(sample_events)
17
- }.to raise_error(Scalyr::Common::Client::ServerError, "error/client/badParam")
18
44
  end
19
45
  end
20
46
 
21
47
  context "when pointing at a location without any valid certs and not using builtin" do
22
48
  it "throws an SSLError" do
23
- expect {
24
49
  plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
25
50
  plugin.register
51
+ plugin.instance_variable_set(:@running, false)
52
+ expect(plugin.instance_variable_get(:@logger)).to receive(:error).with("Error uploading to Scalyr (will backoff-retry)",
53
+ {
54
+ :batch_num=>1,
55
+ :message=>"Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty",
56
+ :payload_size=>781,
57
+ :record_count=>3,
58
+ :total_batches=>1,
59
+ :url=>"https://agent.scalyr.com/addEvents",
60
+ :will_retry_in_seconds=>2
61
+ }
62
+ )
26
63
  plugin.multi_receive(sample_events)
27
- }.to raise_error(OpenSSL::SSL::SSLError, "certificate verify failed")
28
64
  end
29
65
  end
30
66
 
@@ -34,11 +70,21 @@ describe LogStash::Outputs::Scalyr do
34
70
  `sudo mv #{OpenSSL::X509::DEFAULT_CERT_DIR} /tmp/system_certs`
35
71
 
36
72
  begin
37
- expect {
38
73
  plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'append_builtin_cert' => false})
39
74
  plugin.register
75
+ plugin.instance_variable_set(:@running, false)
76
+ expect(plugin.instance_variable_get(:@logger)).to receive(:error).with("Error uploading to Scalyr (will backoff-retry)",
77
+ {
78
+ :batch_num=>1,
79
+ :message=>"Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty",
80
+ :payload_size=>781,
81
+ :record_count=>3,
82
+ :total_batches=>1,
83
+ :url=>"https://agent.scalyr.com/addEvents",
84
+ :will_retry_in_seconds=>2
85
+ }
86
+ )
40
87
  plugin.multi_receive(sample_events)
41
- }.to raise_error(OpenSSL::SSL::SSLError, "certificate verify failed")
42
88
  end
43
89
  ensure
44
90
  `sudo mv /tmp/system_certs #{OpenSSL::X509::DEFAULT_CERT_DIR}`
@@ -61,11 +107,21 @@ describe LogStash::Outputs::Scalyr do
61
107
  `echo "#{etc_hosts_entry}" | sudo tee -a /etc/hosts`
62
108
 
63
109
  begin
64
- expect {
65
110
  plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'scalyr_server' => 'https://invalid.mitm.should.fail.test.agent.scalyr.com:443'})
66
111
  plugin.register
112
+ plugin.instance_variable_set(:@running, false)
113
+ expect(plugin.instance_variable_get(:@logger)).to receive(:error).with("Error uploading to Scalyr (will backoff-retry)",
114
+ {
115
+ :batch_num=>1,
116
+ :message=>"Host name 'invalid.mitm.should.fail.test.agent.scalyr.com' does not match the certificate subject provided by the peer (CN=*.scalyr.com)",
117
+ :payload_size=>781,
118
+ :record_count=>3,
119
+ :total_batches=>1,
120
+ :url=>"https://invalid.mitm.should.fail.test.agent.scalyr.com/addEvents",
121
+ :will_retry_in_seconds=>2
122
+ }
123
+ )
67
124
  plugin.multi_receive(sample_events)
68
- }.to raise_error(OpenSSL::SSL::SSLError, "hostname \"invalid.mitm.should.fail.test.agent.scalyr.com\" does not match the server certificate")
69
125
  ensure
70
126
  # Clean up the hosts file
71
127
  `sudo truncate -s 0 /etc/hosts`
@@ -74,4 +130,88 @@ describe LogStash::Outputs::Scalyr do
74
130
  end
75
131
  end
76
132
  end
133
+
134
+ describe "response_handling_tests" do
135
+ context "when receiving a 503 response" do
136
+ it "don't throw an error but do log one to debug" do
137
+ stub_request(:post, "https://agent.scalyr.com/addEvents").
138
+ to_return(status: 503, body: "stubbed response", headers: {})
139
+
140
+ plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
141
+ plugin.register
142
+ plugin.instance_variable_set(:@running, false)
143
+
144
+ allow(plugin.instance_variable_get(:@logger)).to receive(:debug)
145
+ plugin.multi_receive(sample_events)
146
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:debug).with("Error uploading to Scalyr (will backoff-retry)",
147
+ {
148
+ :batch_num=>1,
149
+ :code=>503,
150
+ :message=>"Invalid JSON response from server",
151
+ :payload_size=>781,
152
+ :record_count=>3,
153
+ :total_batches=>1,
154
+ :url=>"https://agent.scalyr.com/addEvents",
155
+ :will_retry_in_seconds=>2,
156
+ :body=>"stubbed response"
157
+ }
158
+ )
159
+ end
160
+ end
161
+
162
+ context "when receiving a 500 response" do
163
+ it "don't throw an error but do log one to error" do
164
+ stub_request(:post, "https://agent.scalyr.com/addEvents").
165
+ to_return(status: 500, body: "stubbed response", headers: {})
166
+
167
+ plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
168
+ plugin.register
169
+ plugin.instance_variable_set(:@running, false)
170
+
171
+ allow(plugin.instance_variable_get(:@logger)).to receive(:error)
172
+ plugin.multi_receive(sample_events)
173
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
174
+ {
175
+ :batch_num=>1,
176
+ :code=>500,
177
+ :message=>"Invalid JSON response from server",
178
+ :payload_size=>781,
179
+ :record_count=>3,
180
+ :total_batches=>1,
181
+ :url=>"https://agent.scalyr.com/addEvents",
182
+ :will_retry_in_seconds=>2,
183
+ :body=>"stubbed response"
184
+ }
185
+ )
186
+ end
187
+ end
188
+
189
+ context "when receiving a long non-json response" do
190
+ it "don't throw an error but do log one to error" do
191
+ stub_request(:post, "https://agent.scalyr.com/addEvents").
192
+ to_return(status: 500, body: "0123456789" * 52, headers: {})
193
+
194
+ plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
195
+ plugin.register
196
+ plugin.instance_variable_set(:@running, false)
197
+
198
+ allow(plugin.instance_variable_get(:@logger)).to receive(:error)
199
+ plugin.multi_receive(sample_events)
200
+ expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
201
+ {
202
+ :batch_num=>1,
203
+ :code=>500,
204
+ :message=>"Invalid JSON response from server",
205
+ :payload_size=>781,
206
+ :record_count=>3,
207
+ :total_batches=>1,
208
+ :url=>"https://agent.scalyr.com/addEvents",
209
+ :will_retry_in_seconds=>2,
210
+ :body=>("0123456789" * 50) + "012345678..."
211
+ }
212
+ )
213
+ end
214
+ end
215
+ end
216
+
77
217
  end
@@ -78,25 +78,28 @@ describe LogStash::Outputs::Scalyr do
78
78
  mock_client_session = MockClientSession.new
79
79
  plugin1.instance_variable_set(:@last_status_transmit_time, 100)
80
80
  plugin1.instance_variable_set(:@client_session, mock_client_session)
81
+ plugin1.instance_variable_set(:@session_id, "some_session_id")
81
82
  plugin1.instance_variable_set(:@plugin_metrics, {
82
83
  :multi_receive_duration_secs => Quantile::Estimator.new,
83
84
  :multi_receive_event_count => Quantile::Estimator.new,
84
85
  :event_attributes_count => Quantile::Estimator.new,
85
- :flatten_values_duration_secs => Quantile::Estimator.new
86
+ :flatten_values_duration_secs => Quantile::Estimator.new,
87
+ :batches_per_multi_receive => Quantile::Estimator.new
86
88
  })
87
89
  plugin1.instance_variable_get(:@plugin_metrics)[:multi_receive_duration_secs].observe(1)
88
90
  plugin1.instance_variable_set(:@multi_receive_statistics, {:total_multi_receive_secs => 0})
89
91
 
90
92
  status_event = plugin1.send_status
91
- expect(status_event[:attrs]["message"]).to eq("plugin_status: total_requests_sent=20 total_requests_failed=10 total_request_bytes_sent=100 total_compressed_request_bytes_sent=50 total_response_bytes_received=100 total_request_latency_secs=100 total_serialization_duration_secs=100.500 total_compression_duration_secs=10.200 compression_type=deflate compression_level=9 total_multi_receive_secs=0 multi_receive_duration_p50=1 multi_receive_duration_p90=1 multi_receive_duration_p99=1 multi_receive_event_count_p50=0 multi_receive_event_count_p90=0 multi_receive_event_count_p99=0 event_attributes_count_p50=0 event_attributes_count_p90=0 event_attributes_count_p99=0")
93
+ expect(status_event[:attrs]["message"]).to eq("plugin_status: total_requests_sent=20 total_requests_failed=10 total_request_bytes_sent=100 total_compressed_request_bytes_sent=50 total_response_bytes_received=100 total_request_latency_secs=100 total_serialization_duration_secs=100.5000 total_compression_duration_secs=10.2000 compression_type=deflate compression_level=9 total_multi_receive_secs=0 multi_receive_duration_p50=1 multi_receive_duration_p90=1 multi_receive_duration_p99=1 multi_receive_event_count_p50=0 multi_receive_event_count_p90=0 multi_receive_event_count_p99=0 event_attributes_count_p50=0 event_attributes_count_p90=0 event_attributes_count_p99=0 batches_per_multi_receive_p50=0 batches_per_multi_receive_p90=0 batches_per_multi_receive_p99=0")
92
94
  end
93
95
 
94
96
  it "returns and sends correct status event on send_stats on initial and subsequent send" do
95
97
  # 1. Initial send
96
98
  plugin.instance_variable_set(:@last_status_transmit_time, nil)
97
99
  plugin.instance_variable_set(:@client_session, mock_client_session)
100
+ plugin.instance_variable_set(:@session_id, "some_session_id")
98
101
  status_event = plugin.send_status
99
- expect(status_event[:attrs]["message"]).to eq("Started Scalyr LogStash output plugin.")
102
+ expect(status_event[:attrs]["message"]).to eq("Started Scalyr LogStash output plugin (%s)." % [PLUGIN_VERSION])
100
103
 
101
104
  # 2. Second send
102
105
  plugin.instance_variable_set(:@last_status_transmit_time, 100)
@@ -106,7 +109,8 @@ describe LogStash::Outputs::Scalyr do
106
109
  :multi_receive_duration_secs => Quantile::Estimator.new,
107
110
  :multi_receive_event_count => Quantile::Estimator.new,
108
111
  :event_attributes_count => Quantile::Estimator.new,
109
- :flatten_values_duration_secs => Quantile::Estimator.new
112
+ :flatten_values_duration_secs => Quantile::Estimator.new,
113
+ :batches_per_multi_receive => Quantile::Estimator.new
110
114
  })
111
115
 
112
116
  (1..20).each do |n|
@@ -115,7 +119,7 @@ describe LogStash::Outputs::Scalyr do
115
119
 
116
120
  plugin.instance_variable_set(:@multi_receive_statistics, {:total_multi_receive_secs => 0})
117
121
  status_event = plugin.send_status
118
- expect(status_event[:attrs]["message"]).to eq("plugin_status: total_requests_sent=20 total_requests_failed=10 total_request_bytes_sent=100 total_compressed_request_bytes_sent=50 total_response_bytes_received=100 total_request_latency_secs=100 total_serialization_duration_secs=100.500 total_compression_duration_secs=10.200 compression_type=deflate compression_level=9 total_multi_receive_secs=0 multi_receive_duration_p50=10 multi_receive_duration_p90=18 multi_receive_duration_p99=19 multi_receive_event_count_p50=0 multi_receive_event_count_p90=0 multi_receive_event_count_p99=0 event_attributes_count_p50=0 event_attributes_count_p90=0 event_attributes_count_p99=0 flatten_values_duration_secs_p50=0 flatten_values_duration_secs_p90=0 flatten_values_duration_secs_p99=0")
122
+ expect(status_event[:attrs]["message"]).to eq("plugin_status: total_requests_sent=20 total_requests_failed=10 total_request_bytes_sent=100 total_compressed_request_bytes_sent=50 total_response_bytes_received=100 total_request_latency_secs=100 total_serialization_duration_secs=100.5000 total_compression_duration_secs=10.2000 compression_type=deflate compression_level=9 total_multi_receive_secs=0 multi_receive_duration_p50=10 multi_receive_duration_p90=18 multi_receive_duration_p99=19 multi_receive_event_count_p50=0 multi_receive_event_count_p90=0 multi_receive_event_count_p99=0 event_attributes_count_p50=0 event_attributes_count_p90=0 event_attributes_count_p99=0 batches_per_multi_receive_p50=0 batches_per_multi_receive_p90=0 batches_per_multi_receive_p99=0 flatten_values_duration_secs_p50=0 flatten_values_duration_secs_p90=0 flatten_values_duration_secs_p99=0")
119
123
  end
120
124
 
121
125
  it "send_stats is called when events list is empty, but otherwise noop" do
@@ -138,6 +142,7 @@ describe LogStash::Outputs::Scalyr do
138
142
  # 1. Initial send
139
143
  plugin.instance_variable_set(:@last_status_transmit_time, nil)
140
144
  plugin.instance_variable_set(:@client_session, mock_client_session)
145
+ plugin.instance_variable_set(:@session_id, "some_session_id")
141
146
  expect(mock_client_session).to receive(:post_add_events).with(anything, true, anything)
142
147
  plugin.send_status
143
148
 
@@ -148,7 +153,8 @@ describe LogStash::Outputs::Scalyr do
148
153
  :multi_receive_duration_secs => Quantile::Estimator.new,
149
154
  :multi_receive_event_count => Quantile::Estimator.new,
150
155
  :event_attributes_count => Quantile::Estimator.new,
151
- :flatten_values_duration_secs => Quantile::Estimator.new
156
+ :flatten_values_duration_secs => Quantile::Estimator.new,
157
+ :batches_per_multi_receive => Quantile::Estimator.new
152
158
  })
153
159
  (1..20).each do |n|
154
160
  plugin.instance_variable_get(:@plugin_metrics)[:multi_receive_duration_secs].observe(n)