plain_apm 0.10.1 → 0.10.2

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: 380c7c5a078b9d9b650e66ea7daa26109e3a028af6733c845da95784a9848351
4
- data.tar.gz: 4e72c60ed9f5bf063802d27c8b98fe63b236d74eed7b06e9c9aa0bcc0f0d175d
3
+ metadata.gz: 3c48770b73fc39349e83183e81f882964eee3504efb2828ca524651f6df8fcce
4
+ data.tar.gz: c591759e668fce2402e67b4d49cd2b91b2d74304f73f4979bad5862832455b79
5
5
  SHA512:
6
- metadata.gz: bb81d0e597f83f1fe6389fc1732a7c165d69d3e3369ac2b73152de6566ef5c06e1002d910b4dc6b46e0f69b44c4bfb72c33540b62910f3dbc6db8b0b023655fb
7
- data.tar.gz: 4a371c933a3dae7778c80b1f01479048194e60f61929b7fab3eff0b5dffc69144df419f1b92f65545a16a014dade2d4bb318ec33480bd4b885eb02a0d620b074
6
+ metadata.gz: 202d04c8ddf30432c613bcda9abe0a6abb0b73de9fb0a40b57181cdd4e264837b20c641948f867955699227e726e369687454b9a0c8e5d1a00c0f5d4485c9aaa
7
+ data.tar.gz: c16dc0de9bb7bfa110eddb680d0a96da964a5a0ef98bcd1c4c75ea6fcb4f3adc4623bc9e0c7c9621e8a738f87986a5cb33f3cfe4341bb8a115e7b996609c3231
@@ -27,6 +27,9 @@ module PlainApm
27
27
  attrs[:message] = e.message
28
28
  attrs[:backtrace] = e.backtrace
29
29
 
30
+ attrs[:event_time] = now
31
+ attrs[:event_utc_time] = utc_now
32
+
30
33
  if error_source
31
34
  attrs[:event_source] = error_source
32
35
  end
@@ -83,6 +86,10 @@ module PlainApm
83
86
  attrs[:event_time] = event.time
84
87
  attrs[:duration] = event.duration
85
88
 
89
+ if event.respond_to?(:utc_time)
90
+ attrs[:event_utc_time] = event.utc_time
91
+ end
92
+
86
93
  if event.respond_to?(:gc_time)
87
94
  attrs[:gc_time] = event.gc_time
88
95
  end
@@ -115,7 +122,7 @@ module PlainApm
115
122
  # https://bugs.ruby-lang.org/issues/19443 for the feature.
116
123
  def add_trace_attributes(attrs)
117
124
  attrs[:thread_id] = Thread.current.object_id
118
- attrs[:collected_at] = Time.now.to_f
125
+ attrs[:collected_at] = utc_now
119
126
  attrs[:pid] = Process.pid
120
127
  attrs[:version] = PlainApm::VERSION
121
128
  attrs[:hostname] = cached_attributes[:hostname]
@@ -156,6 +163,14 @@ module PlainApm
156
163
  nil
157
164
  end
158
165
 
166
+ def now
167
+ Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)
168
+ end
169
+
170
+ def utc_now
171
+ Time.now.to_f
172
+ end
173
+
159
174
  def self.included(other)
160
175
  other.class_eval do
161
176
  def self.rails_root
@@ -4,6 +4,7 @@ module PlainApm
4
4
  module Event
5
5
  def start!
6
6
  super
7
+ @utc_start = utc_now
7
8
  @thread_allocation_count_start = now_thread_allocations
8
9
  @gc_time_start = now_gc_time
9
10
  @gc_major_count_start = now_gc_major_count
@@ -34,6 +35,10 @@ module PlainApm
34
35
  @gc_minor_count_finish - @gc_minor_count_start
35
36
  end
36
37
 
38
+ def utc_time
39
+ @utc_start
40
+ end
41
+
37
42
  private
38
43
 
39
44
  # Per thread GC counter
@@ -71,6 +76,10 @@ module PlainApm
71
76
  0
72
77
  end
73
78
  end
79
+
80
+ def utc_now
81
+ Time.now.to_f
82
+ end
74
83
  end
75
84
  end
76
85
  end
@@ -26,7 +26,12 @@ module PlainApm
26
26
  o[:path] = payload[:path]
27
27
  o[:status] = payload[:status]
28
28
  end
29
- when "redirect_to", "start_processing", "halted_callback", "send_file", "send_data"
29
+ when "start_processing"
30
+ base.tap do |o|
31
+ o[:controller] = payload[:controller]
32
+ o[:action] = payload[:action]
33
+ end
34
+ when "redirect_to", "halted_callback", "send_file", "send_data"
30
35
  nil
31
36
  when "read_fragment", "write_fragment", "exist_fragment?", "expire_fragment"
32
37
  # controller, action, key
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlainApm
4
- VERSION = "0.10.1"
4
+ VERSION = "0.10.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plain_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - PlainAPM Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-11 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest