influxdb-rails 1.0.0.beta4 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +11 -0
  3. data/.github/workflows/rubocop.yml +18 -0
  4. data/.github/workflows/spec.yml +32 -0
  5. data/.gitignore +1 -0
  6. data/.rubocop.yml +35 -7
  7. data/CHANGELOG.md +40 -3
  8. data/README.md +125 -27
  9. data/Rakefile +0 -6
  10. data/gemfiles/Gemfile.rails-6.0.x +9 -0
  11. data/gemfiles/Gemfile.rails-6.1.x +9 -0
  12. data/influxdb-rails.gemspec +7 -4
  13. data/lib/influxdb-rails.rb +13 -2
  14. data/lib/influxdb/rails/configuration.rb +22 -13
  15. data/lib/influxdb/rails/context.rb +6 -40
  16. data/lib/influxdb/rails/helpers/rspec_matchers.rb +48 -0
  17. data/lib/influxdb/rails/metric.rb +39 -0
  18. data/lib/influxdb/rails/middleware/action_mailer_subscriber.rb +22 -0
  19. data/lib/influxdb/rails/middleware/active_job_subscriber.rb +67 -0
  20. data/lib/influxdb/rails/middleware/active_record_subscriber.rb +26 -0
  21. data/lib/influxdb/rails/middleware/block_instrumentation_subscriber.rb +24 -0
  22. data/lib/influxdb/rails/middleware/render_subscriber.rb +15 -16
  23. data/lib/influxdb/rails/middleware/request_subscriber.rb +16 -21
  24. data/lib/influxdb/rails/middleware/sql_subscriber.rb +18 -18
  25. data/lib/influxdb/rails/middleware/subscriber.rb +40 -27
  26. data/lib/influxdb/rails/railtie.rb +15 -18
  27. data/lib/influxdb/rails/sql/normalizer.rb +3 -3
  28. data/lib/influxdb/rails/tags.rb +33 -0
  29. data/lib/influxdb/rails/test_client.rb +13 -0
  30. data/lib/influxdb/rails/values.rb +24 -0
  31. data/lib/influxdb/rails/version.rb +1 -1
  32. data/lib/rails/generators/influxdb/templates/initializer.rb +4 -0
  33. data/sample-dashboard/Dockerfile +2 -3
  34. data/sample-dashboard/README.md +21 -28
  35. data/sample-dashboard/Rakefile +10 -4
  36. data/sample-dashboard/Ruby On Rails ActiveJob.json +600 -0
  37. data/sample-dashboard/Ruby On Rails Performance per Action.json +1330 -0
  38. data/sample-dashboard/{Ruby On Rails Performance (per Request).json → Ruby On Rails Performance per Request.json } +367 -217
  39. data/sample-dashboard/Ruby On Rails Performance.json +1348 -1110
  40. data/sample-dashboard/Ruby On Rails Requests.json +834 -0
  41. data/sample-dashboard/Ruby On Rails Slowlog by Action.json +278 -0
  42. data/sample-dashboard/Ruby On Rails Slowlog by Request.json +277 -0
  43. data/sample-dashboard/Ruby On Rails Slowlog by SQL.json +328 -0
  44. data/sample-dashboard/docker-compose.yml +7 -1
  45. data/sample-dashboard/provisioning/activejob.json +600 -0
  46. data/sample-dashboard/provisioning/performance-action.json +1330 -0
  47. data/sample-dashboard/provisioning/performance-request.json +361 -211
  48. data/sample-dashboard/provisioning/performance.json +1337 -1099
  49. data/sample-dashboard/provisioning/requests.json +834 -0
  50. data/sample-dashboard/provisioning/slowlog-action.json +278 -0
  51. data/sample-dashboard/provisioning/slowlog-requests.json +277 -0
  52. data/sample-dashboard/provisioning/slowlog-sql.json +328 -0
  53. data/spec/requests/action_controller_metrics_spec.rb +83 -0
  54. data/spec/requests/action_mailer_deliver_metrics_spec.rb +49 -0
  55. data/spec/requests/action_view_collection_metrics_spec.rb +66 -0
  56. data/spec/requests/action_view_partial_metrics_spec.rb +62 -0
  57. data/spec/requests/action_view_template_metrics_spec.rb +62 -0
  58. data/spec/requests/active_job_enqueue_metrics_spec.rb +65 -0
  59. data/spec/requests/active_job_perform_metrics_spec.rb +68 -0
  60. data/spec/requests/active_record_instantiation_metrics_spec.rb +65 -0
  61. data/spec/requests/active_record_sql_metrics_spec.rb +103 -0
  62. data/spec/requests/block_inistrumentation_spec.rb +64 -0
  63. data/spec/requests/context_spec.rb +27 -0
  64. data/spec/requests/logger_spec.rb +10 -0
  65. data/spec/spec_helper.rb +12 -4
  66. data/spec/support/broken_client.rb +11 -0
  67. data/spec/support/rails5/app.rb +48 -13
  68. data/spec/support/rails6/app.rb +83 -0
  69. data/spec/support/views/layouts/mailer.txt.erb +1 -0
  70. data/spec/support/views/{widgets → metrics}/_item.html.erb +0 -0
  71. data/spec/support/views/{widgets → metrics}/index.html.erb +0 -0
  72. data/spec/support/views/metrics/show.html.erb +4 -0
  73. data/spec/unit/block_instrumentation_spec.rb +18 -0
  74. metadata +124 -46
  75. data/.travis.yml +0 -37
  76. data/gemfiles/Gemfile.rails-4.2.x +0 -7
  77. data/gemfiles/Gemfile.rails-5.0.x +0 -7
  78. data/gemfiles/Gemfile.rails-5.1.x +0 -7
  79. data/lib/influxdb/rails/instrumentation.rb +0 -34
  80. data/lib/influxdb/rails/middleware/simple_subscriber.rb +0 -33
  81. data/spec/controllers/widgets_controller_spec.rb +0 -15
  82. data/spec/integration/integration_helper.rb +0 -1
  83. data/spec/integration/metrics_spec.rb +0 -27
  84. data/spec/shared_examples/data.rb +0 -61
  85. data/spec/support/rails4/app.rb +0 -48
  86. data/spec/unit/context_spec.rb +0 -40
  87. data/spec/unit/middleware/render_subscriber_spec.rb +0 -96
  88. data/spec/unit/middleware/request_subscriber_spec.rb +0 -103
  89. data/spec/unit/middleware/sql_subscriber_spec.rb +0 -108
@@ -0,0 +1,64 @@
1
+ require "#{File.dirname(__FILE__)}/../spec_helper"
2
+
3
+ RSpec.describe "BlockInstrumentation metrics", type: :request do
4
+ let(:tags_middleware) do
5
+ lambda do |tags|
6
+ tags.merge(tags_middleware: :tags_middleware)
7
+ end
8
+ end
9
+ before do
10
+ allow_any_instance_of(ActionDispatch::Request).to receive(:request_id).and_return(:request_id)
11
+ allow_any_instance_of(InfluxDB::Rails::Configuration).to receive(:application_name).and_return(:app_name)
12
+ allow_any_instance_of(InfluxDB::Rails::Configuration).to receive(:tags_middleware).and_return(tags_middleware)
13
+ end
14
+
15
+ it "writes metric" do
16
+ get "/metrics"
17
+
18
+ expect_metric(
19
+ tags: a_hash_including(
20
+ location: "MetricsController#index",
21
+ hook: "block_instrumentation",
22
+ additional_tag: :value,
23
+ server: Socket.gethostname,
24
+ app_name: :app_name,
25
+ tags_middleware: :tags_middleware,
26
+ block_tag: :block_tag,
27
+ name: "name"
28
+ ),
29
+ values: a_hash_including(
30
+ additional_value: :value,
31
+ request_id: :request_id,
32
+ block_value: :block_value,
33
+ value: be_between(1, 500)
34
+ )
35
+ )
36
+ end
37
+
38
+ it "includes correct timestamps" do
39
+ travel_to Time.zone.local(2018, 1, 1, 9, 0, 0)
40
+
41
+ get "/metrics"
42
+
43
+ expect_metric(
44
+ tags: a_hash_including(
45
+ location: "MetricsController#index",
46
+ hook: "block_instrumentation"
47
+ ),
48
+ timestamp: 1_514_797_200
49
+ )
50
+ end
51
+
52
+ it "does not write metric when hook is ignored" do
53
+ allow_any_instance_of(InfluxDB::Rails::Configuration).to receive(:ignored_hooks).and_return(["block_instrumentation.influxdb_rails"])
54
+
55
+ get "/metrics"
56
+
57
+ expect_no_metric(
58
+ tags: a_hash_including(
59
+ location: "MetricsController#index",
60
+ hook: "block_instrumentation"
61
+ )
62
+ )
63
+ end
64
+ end
@@ -0,0 +1,27 @@
1
+ require "#{File.dirname(__FILE__)}/../spec_helper"
2
+
3
+ RSpec.describe "Context", type: :request do
4
+ it "resets the context after a request" do
5
+ get "/metrics"
6
+
7
+ expect_metric(
8
+ tags: a_hash_including(
9
+ location: "MetricsController#index",
10
+ hook: "sql"
11
+ )
12
+ )
13
+
14
+ expect(InfluxDB::Rails.current.tags).to be_empty
15
+ expect(InfluxDB::Rails.current.values).to be_empty
16
+ end
17
+
18
+ it "resets the context after a request when exceptioni occurs" do
19
+ setup_broken_client
20
+
21
+ get "/metrics"
22
+
23
+ expect_no_metric(hook: "process_action")
24
+ expect(InfluxDB::Rails.current.tags).to be_empty
25
+ expect(InfluxDB::Rails.current.values).to be_empty
26
+ end
27
+ end
@@ -0,0 +1,10 @@
1
+ require "#{File.dirname(__FILE__)}/../spec_helper"
2
+
3
+ RSpec.describe "Logger", type: :request do
4
+ it "logs exception" do
5
+ setup_broken_client
6
+ expect(Rails.logger).to receive(:error).with(/message/).at_least(:once)
7
+
8
+ get "/metrics"
9
+ end
10
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require "active_support"
4
+ require_relative "../lib/influxdb/rails/helpers/rspec_matchers"
5
+ require File.expand_path("#{File.dirname(__FILE__)}/support/broken_client")
6
+
3
7
  ENV["RAILS_ENV"] ||= "test"
4
8
 
5
9
  require "rails"
@@ -25,9 +29,13 @@ RSpec.configure do |config|
25
29
  # use expect syntax
26
30
  config.disable_monkey_patching!
27
31
 
28
- # reset configuration for each spec
29
- config.before :each do
30
- InfluxDB::Rails.instance_variable_set :@configuration, nil
31
- InfluxDB::Rails.configure
32
+ config.after(:each) do
33
+ travel_back
32
34
  end
35
+
36
+ config.include ActiveSupport::Testing::TimeHelpers
37
+ config.include ActiveSupport::Testing::Assertions
38
+ config.include ActiveJob::TestHelper
39
+
40
+ config.include InfluxDB::Rails::BrokenClient
33
41
  end
@@ -0,0 +1,11 @@
1
+ module InfluxDB
2
+ module Rails
3
+ module BrokenClient
4
+ def setup_broken_client
5
+ client = double
6
+ allow(client).to receive(:write_point).and_raise("message")
7
+ allow(InfluxDB::Rails).to receive(:client).and_return(client)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,7 @@
1
1
  require "action_controller/railtie"
2
- require "active_record"
2
+ require "active_record/railtie"
3
+ require "active_job"
4
+ require "action_mailer"
3
5
 
4
6
  app = Class.new(Rails::Application)
5
7
  app.config.secret_key_base = "1234567890abcdef1234567890abcdef"
@@ -9,38 +11,71 @@ app.config.active_support.deprecation = :log
9
11
  app.config.eager_load = false
10
12
  app.config.root = __dir__
11
13
  Rails.backtrace_cleaner.remove_silencers!
14
+ ActiveJob::Base.logger = Rails.logger
15
+ ActionMailer::Base.delivery_method = :test
12
16
  app.initialize!
13
17
 
14
18
  app.routes.draw do
15
- resources :widgets
19
+ resources :metrics, only: %i[index show]
20
+ resources :exceptions, only: :index
16
21
  end
17
22
 
18
- InfluxDB::Rails.configure do |config|
19
- end
20
-
21
- ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
23
+ ENV["DATABASE_URL"] = "sqlite3::memory:"
22
24
  ActiveRecord::Schema.define do
23
- create_table :widgets, force: true do |t|
24
- t.string :title
25
+ create_table :metrics, force: true do |t|
26
+ t.string :name
25
27
 
26
28
  t.timestamps
27
29
  end
28
30
  end
29
31
 
30
- class Widget < ActiveRecord::Base; end
32
+ class MetricJob < ActiveJob::Base
33
+ queue_as :default
34
+
35
+ def perform
36
+ # Do something later
37
+ end
38
+ end
39
+
40
+ class MetricMailer < ActionMailer::Base
41
+ default from: "from@example.com"
42
+ layout "mailer"
43
+
44
+ def welcome_mail
45
+ mail(to: "eisendieter@werder.de", subject: "Welcome to metrics!") do |format|
46
+ format.text { render plain: "Hello Dieter!" }
47
+ end
48
+ end
49
+ end
50
+
51
+ class Metric < ActiveRecord::Base; end
52
+
31
53
  class ApplicationController < ActionController::Base; end
32
- class WidgetsController < ApplicationController
54
+
55
+ class MetricsController < ApplicationController
33
56
  prepend_view_path File.join(__dir__, "..", "views")
34
57
 
35
58
  before_action do
36
- InfluxDB::Rails.current.values = { key: :value }
59
+ InfluxDB::Rails.current.values = { additional_value: :value }
60
+ InfluxDB::Rails.current.tags = { additional_tag: :value }
37
61
  end
38
62
 
39
63
  def index
40
- Widget.create!(title: "test")
64
+ InfluxDB::Rails.instrument "name", tags: { block_tag: :block_tag }, values: { block_value: :block_value } do
65
+ 1 + 1
66
+ end
67
+ MetricJob.perform_later
68
+ MetricMailer.with(user: "eisendieter").welcome_mail.deliver_now
69
+ Metric.create!(name: "name")
41
70
  end
42
71
 
43
- def new
72
+ def show
73
+ @metric = Metric.find_by(name: "name")
74
+ end
75
+ end
76
+
77
+ class ExceptionsController < ApplicationController
78
+ def index
44
79
  1 / 0
45
80
  end
46
81
  end
@@ -0,0 +1,83 @@
1
+ require "action_controller/railtie"
2
+ require "active_record/railtie"
3
+ require "active_job"
4
+ require "action_mailer"
5
+
6
+ app = Class.new(Rails::Application)
7
+ app.config.secret_key_base = "1234567890abcdef1234567890abcdef"
8
+ app.config.secret_token = "1234567890abcdef1234567890abcdef"
9
+ app.config.session_store :cookie_store, key: "_myapp_session"
10
+ app.config.active_support.deprecation = :log
11
+ app.config.eager_load = false
12
+ app.config.root = __dir__
13
+ Rails.backtrace_cleaner.remove_silencers!
14
+ ActiveJob::Base.logger = Rails.logger
15
+ ActionMailer::Base.delivery_method = :test
16
+ app.initialize!
17
+
18
+ app.routes.draw do
19
+ resources :metrics, only: %i[index show]
20
+ resources :exceptions, only: :index
21
+ end
22
+
23
+ ENV["DATABASE_URL"] = "sqlite3::memory:"
24
+ ActiveRecord::Schema.define do
25
+ create_table :metrics, force: true do |t|
26
+ t.string :name
27
+
28
+ t.timestamps
29
+ end
30
+ end
31
+
32
+ class MetricJob < ActiveJob::Base
33
+ queue_as :default
34
+
35
+ def perform
36
+ # Do something later
37
+ end
38
+ end
39
+
40
+ class MetricMailer < ActionMailer::Base
41
+ default from: "from@example.com"
42
+ layout "mailer"
43
+
44
+ def welcome_mail
45
+ mail(to: "eisendieter@werder.de", subject: "Welcome to metrics!") do |format|
46
+ format.text { render plain: "Hello Dieter!" }
47
+ end
48
+ end
49
+ end
50
+
51
+ class Metric < ActiveRecord::Base; end
52
+
53
+ class ApplicationController < ActionController::Base; end
54
+
55
+ class MetricsController < ApplicationController
56
+ prepend_view_path File.join(__dir__, "..", "views")
57
+
58
+ before_action do
59
+ InfluxDB::Rails.current.values = { additional_value: :value }
60
+ InfluxDB::Rails.current.tags = { additional_tag: :value }
61
+ end
62
+
63
+ def index
64
+ InfluxDB::Rails.instrument "name", tags: { block_tag: :block_tag }, values: { block_value: :block_value } do
65
+ 1 + 1
66
+ end
67
+ MetricJob.perform_later
68
+ MetricMailer.with(user: "eisendieter").welcome_mail.deliver_now
69
+ Metric.create!(name: "name")
70
+ end
71
+
72
+ def show
73
+ @metric = Metric.find_by(name: "name")
74
+ end
75
+ end
76
+
77
+ class ExceptionsController < ApplicationController
78
+ def index
79
+ 1 / 0
80
+ end
81
+ end
82
+
83
+ Object.const_set(:ApplicationHelper, Module.new)
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,4 @@
1
+ <h1>Show</h1>
2
+ <div>
3
+ <%= @metric.name %>
4
+ </div>
@@ -0,0 +1,18 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe InfluxDB::Rails do
4
+ describe ".instrument" do
5
+ it "supports calling wihout a block" do
6
+ InfluxDB::Rails.instrument "name", values: { value: 1 }
7
+
8
+ expect_metric(
9
+ values: a_hash_including(value: 1),
10
+ tags: a_hash_including(
11
+ hook: "block_instrumentation",
12
+ server: Socket.gethostname,
13
+ location: :raw
14
+ )
15
+ )
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta4
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Bruckmayer
8
8
  - Henne Vogelsang
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-10-02 00:00:00.000000000 Z
12
+ date: 2021-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: influxdb
@@ -37,14 +37,42 @@ dependencies:
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '4.2'
40
+ version: '5.0'
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '4.2'
47
+ version: '5.0'
48
+ - !ruby/object:Gem::Dependency
49
+ name: actionmailer
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: activejob
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
48
76
  - !ruby/object:Gem::Dependency
49
77
  name: activerecord
50
78
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +115,20 @@ dependencies:
87
115
  - - ">="
88
116
  - !ruby/object:Gem::Version
89
117
  version: '0'
118
+ - !ruby/object:Gem::Dependency
119
+ name: launchy
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
90
132
  - !ruby/object:Gem::Dependency
91
133
  name: pry
92
134
  requirement: !ruby/object:Gem::Requirement
@@ -163,28 +205,28 @@ dependencies:
163
205
  requirements:
164
206
  - - "~>"
165
207
  - !ruby/object:Gem::Version
166
- version: 0.61.1
208
+ version: 1.9.0
167
209
  type: :development
168
210
  prerelease: false
169
211
  version_requirements: !ruby/object:Gem::Requirement
170
212
  requirements:
171
213
  - - "~>"
172
214
  - !ruby/object:Gem::Version
173
- version: 0.61.1
215
+ version: 1.9.0
174
216
  - !ruby/object:Gem::Dependency
175
217
  name: sqlite3
176
218
  requirement: !ruby/object:Gem::Requirement
177
219
  requirements:
178
- - - '='
220
+ - - ">="
179
221
  - !ruby/object:Gem::Version
180
- version: 1.3.13
222
+ version: '0'
181
223
  type: :development
182
224
  prerelease: false
183
225
  version_requirements: !ruby/object:Gem::Requirement
184
226
  requirements:
185
- - - '='
227
+ - - ">="
186
228
  - !ruby/object:Gem::Version
187
- version: 1.3.13
229
+ version: '0'
188
230
  - !ruby/object:Gem::Dependency
189
231
  name: tzinfo
190
232
  requirement: !ruby/object:Gem::Requirement
@@ -207,60 +249,88 @@ executables: []
207
249
  extensions: []
208
250
  extra_rdoc_files: []
209
251
  files:
252
+ - ".github/dependabot.yml"
253
+ - ".github/workflows/rubocop.yml"
254
+ - ".github/workflows/spec.yml"
210
255
  - ".gitignore"
211
256
  - ".rspec"
212
257
  - ".rubocop.yml"
213
- - ".travis.yml"
214
258
  - CHANGELOG.md
215
259
  - Gemfile
216
260
  - LICENSE.txt
217
261
  - README.md
218
262
  - Rakefile
219
263
  - config.ru
220
- - gemfiles/Gemfile.rails-4.2.x
221
- - gemfiles/Gemfile.rails-5.0.x
222
- - gemfiles/Gemfile.rails-5.1.x
223
264
  - gemfiles/Gemfile.rails-5.2.x
265
+ - gemfiles/Gemfile.rails-6.0.x
266
+ - gemfiles/Gemfile.rails-6.1.x
224
267
  - influxdb-rails.gemspec
225
268
  - lib/influxdb-rails.rb
226
269
  - lib/influxdb/rails/configuration.rb
227
270
  - lib/influxdb/rails/context.rb
228
- - lib/influxdb/rails/instrumentation.rb
271
+ - lib/influxdb/rails/helpers/rspec_matchers.rb
272
+ - lib/influxdb/rails/metric.rb
273
+ - lib/influxdb/rails/middleware/action_mailer_subscriber.rb
274
+ - lib/influxdb/rails/middleware/active_job_subscriber.rb
275
+ - lib/influxdb/rails/middleware/active_record_subscriber.rb
276
+ - lib/influxdb/rails/middleware/block_instrumentation_subscriber.rb
229
277
  - lib/influxdb/rails/middleware/render_subscriber.rb
230
278
  - lib/influxdb/rails/middleware/request_subscriber.rb
231
- - lib/influxdb/rails/middleware/simple_subscriber.rb
232
279
  - lib/influxdb/rails/middleware/sql_subscriber.rb
233
280
  - lib/influxdb/rails/middleware/subscriber.rb
234
281
  - lib/influxdb/rails/railtie.rb
235
282
  - lib/influxdb/rails/sql/normalizer.rb
236
283
  - lib/influxdb/rails/sql/query.rb
284
+ - lib/influxdb/rails/tags.rb
285
+ - lib/influxdb/rails/test_client.rb
286
+ - lib/influxdb/rails/values.rb
237
287
  - lib/influxdb/rails/version.rb
238
288
  - lib/rails/generators/influxdb/influxdb_generator.rb
239
289
  - lib/rails/generators/influxdb/templates/initializer.rb
240
290
  - sample-dashboard/Dockerfile
241
291
  - sample-dashboard/README.md
242
292
  - sample-dashboard/Rakefile
243
- - sample-dashboard/Ruby On Rails Performance (per Request).json
293
+ - sample-dashboard/Ruby On Rails ActiveJob.json
294
+ - sample-dashboard/Ruby On Rails Performance per Action.json
295
+ - sample-dashboard/Ruby On Rails Performance per Request.json
244
296
  - sample-dashboard/Ruby On Rails Performance.json
297
+ - sample-dashboard/Ruby On Rails Requests.json
298
+ - sample-dashboard/Ruby On Rails Slowlog by Action.json
299
+ - sample-dashboard/Ruby On Rails Slowlog by Request.json
300
+ - sample-dashboard/Ruby On Rails Slowlog by SQL.json
245
301
  - sample-dashboard/docker-compose.yml
302
+ - sample-dashboard/provisioning/activejob.json
246
303
  - sample-dashboard/provisioning/grafana-dashboards.yml
247
304
  - sample-dashboard/provisioning/grafana-datasource.yml
305
+ - sample-dashboard/provisioning/performance-action.json
248
306
  - sample-dashboard/provisioning/performance-request.json
249
307
  - sample-dashboard/provisioning/performance.json
250
- - spec/controllers/widgets_controller_spec.rb
251
- - spec/integration/integration_helper.rb
252
- - spec/integration/metrics_spec.rb
253
- - spec/shared_examples/data.rb
308
+ - sample-dashboard/provisioning/requests.json
309
+ - sample-dashboard/provisioning/slowlog-action.json
310
+ - sample-dashboard/provisioning/slowlog-requests.json
311
+ - sample-dashboard/provisioning/slowlog-sql.json
312
+ - spec/requests/action_controller_metrics_spec.rb
313
+ - spec/requests/action_mailer_deliver_metrics_spec.rb
314
+ - spec/requests/action_view_collection_metrics_spec.rb
315
+ - spec/requests/action_view_partial_metrics_spec.rb
316
+ - spec/requests/action_view_template_metrics_spec.rb
317
+ - spec/requests/active_job_enqueue_metrics_spec.rb
318
+ - spec/requests/active_job_perform_metrics_spec.rb
319
+ - spec/requests/active_record_instantiation_metrics_spec.rb
320
+ - spec/requests/active_record_sql_metrics_spec.rb
321
+ - spec/requests/block_inistrumentation_spec.rb
322
+ - spec/requests/context_spec.rb
323
+ - spec/requests/logger_spec.rb
254
324
  - spec/spec_helper.rb
255
- - spec/support/rails4/app.rb
325
+ - spec/support/broken_client.rb
256
326
  - spec/support/rails5/app.rb
257
- - spec/support/views/widgets/_item.html.erb
258
- - spec/support/views/widgets/index.html.erb
327
+ - spec/support/rails6/app.rb
328
+ - spec/support/views/layouts/mailer.txt.erb
329
+ - spec/support/views/metrics/_item.html.erb
330
+ - spec/support/views/metrics/index.html.erb
331
+ - spec/support/views/metrics/show.html.erb
332
+ - spec/unit/block_instrumentation_spec.rb
259
333
  - spec/unit/configuration_spec.rb
260
- - spec/unit/context_spec.rb
261
- - spec/unit/middleware/render_subscriber_spec.rb
262
- - spec/unit/middleware/request_subscriber_spec.rb
263
- - spec/unit/middleware/sql_subscriber_spec.rb
264
334
  - spec/unit/sql/normalizer_spec.rb
265
335
  - spec/unit/sql/query_spec.rb
266
336
  homepage: https://influxdata.com
@@ -271,7 +341,7 @@ metadata:
271
341
  changelog_uri: https://github.com/influxdata/influxdb-rails/blob/master/CHANGELOG.md
272
342
  documentation_uri: https://github.com/influxdata/influxdb-rails/blob/master/README.md
273
343
  source_code_uri: https://github.com/influxdata/influxdb-rails
274
- post_install_message:
344
+ post_install_message:
275
345
  rdoc_options: []
276
346
  require_paths:
277
347
  - lib
@@ -279,31 +349,39 @@ required_ruby_version: !ruby/object:Gem::Requirement
279
349
  requirements:
280
350
  - - ">="
281
351
  - !ruby/object:Gem::Version
282
- version: 2.3.0
352
+ version: 2.4.0
283
353
  required_rubygems_version: !ruby/object:Gem::Requirement
284
354
  requirements:
285
- - - ">"
355
+ - - ">="
286
356
  - !ruby/object:Gem::Version
287
- version: 1.3.1
357
+ version: '0'
288
358
  requirements: []
289
- rubygems_version: 3.0.1
290
- signing_key:
359
+ rubygems_version: 3.1.4
360
+ signing_key:
291
361
  specification_version: 4
292
362
  summary: InfluxDB bindings for Ruby on Rails.
293
363
  test_files:
294
- - spec/controllers/widgets_controller_spec.rb
295
- - spec/integration/integration_helper.rb
296
- - spec/integration/metrics_spec.rb
297
- - spec/shared_examples/data.rb
364
+ - spec/requests/action_controller_metrics_spec.rb
365
+ - spec/requests/action_mailer_deliver_metrics_spec.rb
366
+ - spec/requests/action_view_collection_metrics_spec.rb
367
+ - spec/requests/action_view_partial_metrics_spec.rb
368
+ - spec/requests/action_view_template_metrics_spec.rb
369
+ - spec/requests/active_job_enqueue_metrics_spec.rb
370
+ - spec/requests/active_job_perform_metrics_spec.rb
371
+ - spec/requests/active_record_instantiation_metrics_spec.rb
372
+ - spec/requests/active_record_sql_metrics_spec.rb
373
+ - spec/requests/block_inistrumentation_spec.rb
374
+ - spec/requests/context_spec.rb
375
+ - spec/requests/logger_spec.rb
298
376
  - spec/spec_helper.rb
299
- - spec/support/rails4/app.rb
377
+ - spec/support/broken_client.rb
300
378
  - spec/support/rails5/app.rb
301
- - spec/support/views/widgets/_item.html.erb
302
- - spec/support/views/widgets/index.html.erb
379
+ - spec/support/rails6/app.rb
380
+ - spec/support/views/layouts/mailer.txt.erb
381
+ - spec/support/views/metrics/_item.html.erb
382
+ - spec/support/views/metrics/index.html.erb
383
+ - spec/support/views/metrics/show.html.erb
384
+ - spec/unit/block_instrumentation_spec.rb
303
385
  - spec/unit/configuration_spec.rb
304
- - spec/unit/context_spec.rb
305
- - spec/unit/middleware/render_subscriber_spec.rb
306
- - spec/unit/middleware/request_subscriber_spec.rb
307
- - spec/unit/middleware/sql_subscriber_spec.rb
308
386
  - spec/unit/sql/normalizer_spec.rb
309
387
  - spec/unit/sql/query_spec.rb