remnant 0.4.3 → 0.4.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.
@@ -28,28 +28,7 @@ class Remnant
28
28
 
29
29
  extra_remnant_key = Remnant::Discover.results.delete(:extra_remnant_key)
30
30
 
31
- if ::Rails.env.production? || ::Rails.env.staging? || ::Rails.env.demo?
32
- # only log if above sample rate
33
- if @sample_counter > configuration.sample_rate
34
- key_prefix = [
35
- Remnant.configuration.tag,
36
- Remnant.configuration.env,
37
- extra_remnant_key
38
- ].compact.join('.')
39
-
40
- Remnant::Discover.results.map do |remnant_key, ms|
41
- Remnant.handler.timing("#{key_prefix}.#{remnant_key}", ms.to_i)
42
- end
43
-
44
- Remnant.handler.timing("#{key_prefix}.gc", Remnant::GC.time.to_i)
45
- Remnant.handler.timing("#{key_prefix}.db", Remnant::Database.total_time.to_i)
46
- Remnant.handler.timing("#{key_prefix}.filters", Remnant::Filters.total_time.to_i)
47
-
48
- @sample_counter = 0
49
- else
50
- @sample_counter += 1
51
- end
52
- else
31
+ if ::Rails.env.development? || ::Rails.env.test?
53
32
  # always log in development mode
54
33
  Rails.logger.info "#{color(false, true)}--------------Remnants Discovered--------------#{color(true)}"
55
34
 
@@ -91,6 +70,27 @@ class Remnant
91
70
  end
92
71
 
93
72
  Rails.logger.info "#{color(false, true)}-----------------------------------------------#{color(true)}"
73
+ else
74
+ # only log if above sample rate
75
+ if @sample_counter > configuration.sample_rate
76
+ key_prefix = [
77
+ Remnant.configuration.tag,
78
+ Remnant.configuration.env,
79
+ extra_remnant_key
80
+ ].compact.join('.')
81
+
82
+ Remnant::Discover.results.map do |remnant_key, ms|
83
+ Remnant.handler.timing("#{key_prefix}.#{remnant_key}", ms.to_i)
84
+ end
85
+
86
+ Remnant.handler.timing("#{key_prefix}.gc", Remnant::GC.time.to_i)
87
+ Remnant.handler.timing("#{key_prefix}.db", Remnant::Database.total_time.to_i)
88
+ Remnant.handler.timing("#{key_prefix}.filters", Remnant::Filters.total_time.to_i)
89
+
90
+ @sample_counter = 0
91
+ else
92
+ @sample_counter += 1
93
+ end
94
94
  end
95
95
 
96
96
  # run hook if given
@@ -1,3 +1,3 @@
1
1
  class Remnant
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remnant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-26 00:00:00.000000000 Z
12
+ date: 2013-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: statsd-ruby