influxdb-rails 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83d8562fc4771f811d477633b9f525887b9ee756
4
- data.tar.gz: e0e20f99c93955e5f26f6ab6736853a892a12fa8
3
+ metadata.gz: 35f471a2ffda4c8e99f655a76495be2e905e95cb
4
+ data.tar.gz: c00248d373decf1fc154477d12af68094b4b3460
5
5
  SHA512:
6
- metadata.gz: 0b49739970a312a124277407741d1668726785db87938fa627eba0c032d13ed2f0bf00bf28704b8d48156867a12d38dd3eadb26f724935588f144b64638c4ccf
7
- data.tar.gz: 381a5e180289b194a45a1b3f74067eb0e38739075642f305b4085d0be50106ddf2ca5fe0cb4babbe1b2566beee3b86cb5c8db5d89d8e1ebc893acd61b12b9eec
6
+ metadata.gz: 1ce921aceae8a76e3061950467c3802d97de5d8ead200b6fc02c32401fdf929f4b2b616bed0e0ad3b6c3964fa9eec0143f501725dba75dad1e1c2b4d6529b5f1
7
+ data.tar.gz: ca89d9fb3af58b642a1d068db1e9411a82906a33c2956d661056d3c43968d71bc1d2a80b568908c30054c4bad58bf4bf63e030c436805c13b34084641b29c1a7
Binary file
@@ -46,9 +46,8 @@ module InfluxDB
46
46
  exception_presenter = ExceptionPresenter.new(e, env)
47
47
  log :info, "Exception: #{exception_presenter.to_json[0..512]}..."
48
48
 
49
- InfluxDB::Rails.client.write_point "rails.exceptions",
50
- :context => exception_presenter.context,
51
- :dimensions => exception_presenter.dimensions
49
+ client.write_point "rails.exceptions",
50
+ exception_presenter.context.merge(exception_presenter.dimensions)
52
51
 
53
52
  rescue => e
54
53
  log :info, "[InfluxDB::Rails] Something went terribly wrong. Exception failed to take off! #{e.class}: #{e.message}"
@@ -5,10 +5,10 @@ module InfluxDB
5
5
  start = Time.now
6
6
  yield
7
7
 
8
- unless InfluxDB.configuration.ignore_current_environment?
8
+ unless InfluxDB::Rails.configuration.ignore_current_environment?
9
9
  elapsed = ((Time.now - start) * 1000).ceil
10
- dimensions = { :method => "#{controller_name}##{action_name}", :server => Socket.gethostname }
11
- InfluxDB.aggregate "instrumentation", :value => elapsed, :dimensions => dimensions
10
+ InfluxDB::Rails.client.write_point "instrumentation",
11
+ :value => elapsed, :method => "#{controller_name}##{action_name}", :server => Socket.gethostname
12
12
  end
13
13
  end
14
14
 
@@ -21,8 +21,8 @@ module InfluxDB
21
21
  def handle_exception(e)
22
22
  request_data = influxdb_request_data || {}
23
23
 
24
- unless InfluxDB.configuration.ignore_user_agent?(request_data[:user_agent])
25
- InfluxDB.report_exception_unless_ignorable(e, request_data)
24
+ unless InfluxDB::Rails.configuration.ignore_user_agent?(request_data[:user_agent])
25
+ InfluxDB::Rails.report_exception_unless_ignorable(e, request_data)
26
26
  end
27
27
  end
28
28
  end
@@ -13,7 +13,7 @@ module InfluxDB
13
13
  begin
14
14
  status, headers, body = @app.call(env)
15
15
  rescue => e
16
- InfluxDB.transmit_unless_ignorable(e, env)
16
+ InfluxDB::Rails.transmit_unless_ignorable(e, env)
17
17
  raise(e)
18
18
  ensure
19
19
  _body = []
@@ -1,5 +1,5 @@
1
1
  module InfluxDB
2
2
  module Rails
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Persen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-26 00:00:00.000000000 Z
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: influxdb
@@ -157,6 +157,7 @@ files:
157
157
  - gemfiles/Gemfile.rails-3.2.x.lock
158
158
  - gemfiles/Gemfile.rails-4.0.x
159
159
  - gemfiles/Gemfile.rails-4.0.x.lock
160
+ - influxdb-rails-0.1.4.gem
160
161
  - influxdb-rails.gemspec
161
162
  - lib/influxdb-rails.rb
162
163
  - lib/influxdb/rails/air_traffic_controller.rb
@@ -168,7 +169,6 @@ files:
168
169
  - lib/influxdb/rails/middleware/hijack_render_exception.rb
169
170
  - lib/influxdb/rails/middleware/hijack_rescue_action_everywhere.rb
170
171
  - lib/influxdb/rails/rack.rb
171
- - lib/influxdb/rails/rails.rb
172
172
  - lib/influxdb/rails/railtie.rb
173
173
  - lib/influxdb/rails/version.rb
174
174
  - lib/rails/generators/influxdb/influxdb_generator.rb
@@ -1,39 +0,0 @@
1
- require 'action_controller'
2
- require 'influxdb'
3
- require 'influxdb/rails/middleware/hijack_rescue_action_everywhere'
4
- require 'influxdb/rails/air_traffic_controller'
5
- require 'influxdb/rails/benchmarking'
6
- require 'influxdb/rails/instrumentation'
7
-
8
- module InfluxDB
9
- module Rails
10
- def self.initialize
11
- ActionController::Base.send(:include, InfluxDB::Rails::AirTrafficController)
12
- ActionController::Base.send(:include, InfluxDB::Rails::Middleware::HijackRescueActionEverywhere)
13
- ActionController::Base.send(:include, InfluxDB::Rails::Benchmarking)
14
- ActionController::Base.send(:include, InfluxDB::Rails::Instrumentation)
15
-
16
- ::Rails.configuration.middleware.insert_after 'ActionController::Failsafe', InfluxDB::Rack
17
-
18
- InfluxDB.configure(true) do |config|
19
- config.logger ||= ::Rails.logger
20
- config.debug = true
21
- config.environment ||= ::Rails.env
22
- config.application_root ||= ::Rails.root
23
- config.application_name ||= "Application"
24
- config.framework = "Rails"
25
- config.framework_version = ::Rails.version
26
- end
27
-
28
- if defined?(PhusionPassenger)
29
- PhusionPassenger.on_event(:starting_worker_process) do |forked|
30
- InfluxDB::Worker.spawn_threads() if forked
31
- end
32
- else
33
- InfluxDB::Worker.spawn_threads()
34
- end
35
- end
36
- end
37
- end
38
-
39
- InfluxDB::Rails.initialize