appsignal-elasticsearch 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6484c8c72b72398adbfa35aaca6f97e37a6ca9ae
4
- data.tar.gz: 124d63d639faed89b7feafba6ea713202f55da9f
3
+ metadata.gz: 30d884e188bd33750a43b2bb8c0378d16938dae9
4
+ data.tar.gz: 26ccd4542de5354f334e722382982129efc98c32
5
5
  SHA512:
6
- metadata.gz: 7a4e4a147d22cb13aea1749db8a7eebc02d91cfde2e576b820d3f7eb0cdd4c30a6a26a91eb7db7c7fbf033d7832f6c5e5c48435a31779688cf812335c6d0ebb8
7
- data.tar.gz: 8e2b60f0bf7f53ceb8c6894e3fbc5c12bef24ea536d7fab12e93254abd821cfac70edb42ed6fc335f0d73b7a2cdcbd505493425045991da5cc8f81d822614ac8
6
+ metadata.gz: 00fc18cf9d67c44a433c1e37ccf36b35d04ded034f776eb4e4588fa6f8a4218b9c877e0a92d835c0b16c752c0073c0b372e71577fd5f9212a6947d2eb38ba563
7
+ data.tar.gz: 4a7bbb4a31b9cef220cc4710fc8350f8b0fdf4e42388b8df00f2afb6b20b17a2a49d9faa9f245ef2ec206506fe17e6e82d6e2b7250931ee1f13d77f5f58deacf
@@ -1,6 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require 'appsignal'
3
- require File.expand_path('../lib/appsignal/elasticsearch/version', __FILE__)
2
+ require File.expand_path('../lib/appsignal-elasticsearch/version', __FILE__)
4
3
 
5
4
  Gem::Specification.new do |gem|
6
5
  gem.authors = ['Mike Kim']
@@ -1 +1,25 @@
1
- require 'appsignal/elasticsearch'
1
+ require 'elasticsearch'
2
+ require 'active_support'
3
+
4
+ module Appsignal
5
+ module Elasticsearch
6
+ module Instrumentation
7
+
8
+ def perform_request_with_appsignal_instrumentation(method, path, params, body, &block)
9
+ args = { method: method, path: path, params: params, body: body }
10
+ ActiveSupport::Notifications.instrument(
11
+ 'query.elasticsearch', :query => args) do
12
+ perform_request_without_appsignal_instrumentation(method, path, params, body, &block)
13
+ end
14
+ end
15
+
16
+ end
17
+ end
18
+ end
19
+
20
+ ::Elasticsearch::Transport::Client.class_eval do
21
+ include Appsignal::Elasticsearch::Instrumentation
22
+
23
+ alias_method :perform_request_without_appsignal_instrumentation, :perform_request
24
+ alias_method :perform_request, :perform_request_with_appsignal_instrumentation
25
+ end
@@ -1,5 +1,5 @@
1
1
  module Appsignal
2
2
  module Elasticsearch
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Kim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-10 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appsignal
@@ -123,10 +123,7 @@ files:
123
123
  - Rakefile
124
124
  - appsignal-elasticsearch.gemspec
125
125
  - lib/appsignal-elasticsearch.rb
126
- - lib/appsignal.rb
127
- - lib/appsignal/elasticsearch.rb
128
- - lib/appsignal/elasticsearch/instrumentation.rb
129
- - lib/appsignal/elasticsearch/version.rb
126
+ - lib/appsignal-elasticsearch/version.rb
130
127
  - spec/appsignal_elasticsearch_spec.rb
131
128
  - spec/spec_helper.rb
132
129
  homepage: https://github.com/mykoweb/appsignal-elasticsearch
@@ -1,2 +0,0 @@
1
- module Appsignal
2
- end
@@ -1,7 +0,0 @@
1
- require 'appsignal/elasticsearch/instrumentation'
2
- require 'appsignal/elasticsearch/version'
3
-
4
- module Appsignal
5
- module Elasticsearch
6
- end
7
- end
@@ -1,24 +0,0 @@
1
- require 'elasticsearch'
2
- require 'active_support'
3
-
4
- module Appsignal
5
- module Elasticsearch
6
- module Instrumentation
7
- def perform_request_with_appsignal_instrumentation(method, path, params, body, &block)
8
- args = { method: method, path: path, params: params, body: body }
9
- ActiveSupport::Notifications.instrument(
10
- 'query.elasticsearch', :query => args) do
11
- perform_request_without_appsignal_instrumentation(method, path, params, body, &block)
12
- end
13
- end
14
-
15
- end
16
- end
17
- end
18
-
19
- ::Elasticsearch::Transport::Client.class_eval do
20
- include Appsignal::Elasticsearch::Instrumentation
21
-
22
- alias_method :perform_request_without_appsignal_instrumentation, :perform_request
23
- alias_method :perform_request, :perform_request_with_appsignal_instrumentation
24
- end