15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/remnant/base.rb', line 15
def collect
@sample_counter ||= 0
= Remnant::Discover.results.delete(:extra_remnant_key)
if ::Rails.env.production? || ::Rails.env.staging? || ::Rails.env.demo?
if @sample_counter > configuration.sample_rate
Remnant::Discover.results.map do |remnant_key, ms|
key = [
Remnant.configuration.tag,
Remnant.configuration.env,
,
remnant_key
].compact.join('.')
Remnant.handler.timing(key, ms.to_i)
end
@sample_counter = 0
else
@sample_counter += 1
end
else
Rails.logger.info "--------------Remnants Discovered--------------"
Remnant::Discover.results.map do |remnant_key, ms|
key = [
,
remnant_key
].compact.join('.')
Rails.logger.info "#{ms.to_i}ms\t#{key}"
end
Rails.logger.info "-----------------------------------------------"
end
Remnant::Discover.results.clear
end
|