traxor 0.1.15 → 0.1.16

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
  SHA256:
3
- metadata.gz: 9e4da239d870978c6eff4d74f12d9b2f2dd498b1746ff66aadf7f78b6b24b9f7
4
- data.tar.gz: bcbfd72fab4d42c3c791740ee48066de99ae5df571d89b1114d6d03841f31587
3
+ metadata.gz: f653d55d85f92371818f8b7b54b042b2f3f5a22ff0132c79bd188b6394275e3f
4
+ data.tar.gz: 59b6e815cdba3b93aa754e5bceefd992a7f38c6112615ea9c0cf1ff9dcb0fcaf
5
5
  SHA512:
6
- metadata.gz: 1b013ac839338b084e7f939e27ead2c4107449e6c2a36272e05208b428b63fdda5504e5c641f28fec56b33bad908b7047353aa2020cc69eb5e10fe424c742d99
7
- data.tar.gz: 83353eee51881dd5f1b2faac734427415a0746c7d8c322ee634c2875e4cc87492323acd1664d979814ea7e570eaa0462a3c73e5a9ae2737665f6d5235fd7081c
6
+ metadata.gz: 0cdda8a4bd223a5eed22fc3069db8669c492e36f8d45a18ff85a1ded44a3c5db8d855b2b4c6ab3e13dfa9deb8b75f2ba90f14292858eed6a0efcae3530bac901
7
+ data.tar.gz: 92c9a20fac4f19a625659b2e74b6b4a9b6096d4d562897130aef16f2843b7214cb5df907a1a27839511af1b9bc881c3dbeaf94213cd44a02b14555914a58bccc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- traxor (0.1.15)
4
+ traxor (0.1.16)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -2,10 +2,10 @@ module Traxor
2
2
  ActiveSupport::Notifications.subscribe('request.faraday'.freeze) do |*args|
3
3
  event = ActiveSupport::Notifications::Event.new(*args)
4
4
  url = event.payload[:url]
5
- duration = event.duration || 0.0
5
+ duration = (event.duration || 0.0).to_f
6
6
  tags = { faraday_host: url.host, faraday_method: event.payload[:method] }
7
7
 
8
8
  Metric.count 'faraday.request.count'.freeze, 1, tags
9
- Metric.measure 'faraday.request.duration'.freeze, "#{duration.to_f.round(2)}ms", tags
9
+ Metric.measure 'faraday.request.duration'.freeze, "#{duration.round(2)}ms", tags if duration.positive?
10
10
  end
11
11
  end
@@ -11,16 +11,16 @@ module Traxor
11
11
  ActiveSupport::Notifications.subscribe 'process_action.action_controller'.freeze do |*args|
12
12
  event = ActiveSupport::Notifications::Event.new(*args)
13
13
  exception = event.payload[:exception]
14
- duration = event.duration || 0.0
15
- db_runtime = event.payload[:db_runtime] || 0.0
16
- view_runtime = event.payload[:view_runtime] || 0.0
17
- ruby_runtime = duration.to_f - db_runtime.to_f - view_runtime.to_f
14
+ duration = (event.duration || 0.0).to_f
15
+ db_runtime = (event.payload[:db_runtime] || 0.0).to_f
16
+ view_runtime = (event.payload[:view_runtime] || 0.0).to_f
17
+ ruby_runtime = duration - db_runtime - view_runtime
18
18
 
19
19
  Metric.count 'rails.action_controller.count'.freeze, 1
20
- Metric.measure 'rails.action_controller.total.duration'.freeze, "#{duration.to_f.round(2)}ms"
21
- Metric.measure 'rails.action_controller.ruby.duration'.freeze, "#{ruby_runtime.to_f.round(2)}ms"
22
- Metric.measure 'rails.action_controller.db.duration'.freeze, "#{db_runtime.to_f.round(2)}ms"
23
- Metric.measure 'rails.action_controller.view.duration'.freeze, "#{view_runtime.to_f.round(2)}ms"
20
+ Metric.measure 'rails.action_controller.total.duration'.freeze, "#{duration.round(2)}ms" if duration.positive?
21
+ Metric.measure 'rails.action_controller.ruby.duration'.freeze, "#{ruby_runtime.round(2)}ms" if ruby_runtime.positive?
22
+ Metric.measure 'rails.action_controller.db.duration'.freeze, "#{db_runtime.round(2)}ms" if db_runtime.positive?
23
+ Metric.measure 'rails.action_controller.view.duration'.freeze, "#{view_runtime.round(2)}ms" if view_runtime.positive?
24
24
  Metric.count 'rails.action_controller.exception.count'.freeze, 1 if exception
25
25
  end
26
26
  end
@@ -16,9 +16,9 @@ module Traxor
16
16
 
17
17
  ActiveSupport::Notifications.subscribe 'instantiation.active_record'.freeze do |*args|
18
18
  event = ActiveSupport::Notifications::Event.new(*args)
19
- record_count = event.payload[:record_count]
19
+ record_count = event.payload[:record_count].to_i
20
20
  tags = { active_record_class_name: event.payload[:class_name] }
21
21
 
22
- Metric.count 'rails.active_record.instantiation.count'.freeze, record_count, tags
22
+ Metric.count 'rails.active_record.instantiation.count'.freeze, record_count, tags if record_count.positive?
23
23
  end
24
24
  end
@@ -11,7 +11,7 @@ module Traxor
11
11
  time = Benchmark.ms do
12
12
  yield
13
13
  end
14
- Metric.measure 'sidekiq.worker.duration'.freeze, "#{time.round(2)}ms", tags
14
+ Metric.measure 'sidekiq.worker.duration'.freeze, "#{time.round(2)}ms", tags if time.positive?
15
15
  Metric.count 'sidekiq.worker.count'.freeze, 1, tags
16
16
  rescue StandardError
17
17
  Metric.count 'sidekiq.worker.exception.count'.freeze, 1, tags
@@ -1,3 +1,3 @@
1
1
  module Traxor
2
- VERSION = '0.1.15'.freeze
2
+ VERSION = '0.1.16'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traxor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Hansen