appsignal 0.12.beta.11 → 0.12.beta.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/appsignal_extension.c +35 -28
- data/lib/appsignal/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3689f828f3bf36b1611e6c48735d8ded959018d
|
4
|
+
data.tar.gz: 6891cb3f1b689a1b0546403b0c2e4d54f537703a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5b294da4d1c3d2f91f99fa2c3a7cffd8682f0a392475456c6e9607345d94d0ae0ffa10c9f421572695a8e9e8552035687ecb1269493d5cb24f3d9048b3de2ae
|
7
|
+
data.tar.gz: c786a62377f1e1346ea12cad1785fd74ba3c5483060cba18815d4874c7206a40bc54689fd336a3a1e219908892d6269cc952cb80a6404ba9c6cb769d76b3e66e
|
data/ext/appsignal_extension.c
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
#include "ruby/ruby.h"
|
2
|
-
#include "ruby/debug.h"
|
3
2
|
#include "appsignal_extension.h"
|
4
3
|
|
5
4
|
static VALUE start(VALUE self) {
|
@@ -158,41 +157,49 @@ static VALUE add_distribution_value(VALUE self, VALUE key, VALUE value) {
|
|
158
157
|
return Qnil;
|
159
158
|
}
|
160
159
|
|
161
|
-
static void track_allocation(VALUE
|
160
|
+
static void track_allocation(rb_event_flag_t flag, VALUE arg1, VALUE arg2, ID arg3, VALUE arg4) {
|
162
161
|
appsignal_track_allocation();
|
163
162
|
}
|
164
163
|
|
165
|
-
static void
|
166
|
-
|
167
|
-
|
164
|
+
static void track_gc_start(rb_event_flag_t flag, VALUE arg1, VALUE arg2, ID arg3, VALUE arg4) {
|
165
|
+
appsignal_track_gc_start();
|
166
|
+
}
|
168
167
|
|
169
|
-
|
170
|
-
|
171
|
-
appsignal_track_gc_start();
|
172
|
-
case RUBY_INTERNAL_EVENT_GC_END_SWEEP:
|
173
|
-
appsignal_track_gc_end();
|
174
|
-
}
|
168
|
+
static void track_gc_end(rb_event_flag_t flag, VALUE arg1, VALUE arg2, ID arg3, VALUE arg4) {
|
169
|
+
appsignal_track_gc_end();
|
175
170
|
}
|
176
171
|
|
177
|
-
static void
|
172
|
+
static void install_event_hooks() {
|
173
|
+
// These event hooks are only available on Ruby 2.1 and 2.2
|
178
174
|
#if defined(RUBY_INTERNAL_EVENT_NEWOBJ)
|
179
|
-
|
180
|
-
Qnil,
|
181
|
-
RUBY_INTERNAL_EVENT_NEWOBJ,
|
175
|
+
rb_add_event_hook(
|
182
176
|
track_allocation,
|
183
|
-
|
177
|
+
RUBY_INTERNAL_EVENT_NEWOBJ,
|
178
|
+
Qnil
|
179
|
+
);
|
180
|
+
#endif
|
181
|
+
#if defined(RUBY_INTERNAL_EVENT_GC_START)
|
182
|
+
rb_add_event_hook(
|
183
|
+
track_gc_start,
|
184
|
+
RUBY_INTERNAL_EVENT_GC_START,
|
185
|
+
Qnil
|
186
|
+
);
|
187
|
+
#endif
|
188
|
+
#if defined(RUBY_INTERNAL_EVENT_GC_END_SWEEP)
|
189
|
+
// Ruby 2.1
|
190
|
+
rb_add_event_hook(
|
191
|
+
track_gc_end,
|
192
|
+
RUBY_INTERNAL_EVENT_GC_END_SWEEP,
|
193
|
+
Qnil
|
184
194
|
);
|
185
|
-
rb_tracepoint_enable(allocation_tracer);
|
186
195
|
#endif
|
187
|
-
#if defined(
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
0
|
196
|
+
#if defined(RUBY_INTERNAL_EVENT_GC_END)
|
197
|
+
// Ruby 2.2
|
198
|
+
rb_add_event_hook(
|
199
|
+
track_gc_end,
|
200
|
+
RUBY_INTERNAL_EVENT_GC_END,
|
201
|
+
Qnil
|
194
202
|
);
|
195
|
-
rb_tracepoint_enable(gc_tracer);
|
196
203
|
#endif
|
197
204
|
}
|
198
205
|
|
@@ -208,7 +215,7 @@ void Init_appsignal_extension(void) {
|
|
208
215
|
rb_define_singleton_method(Extension, "finish_event", finish_event, 4);
|
209
216
|
rb_define_singleton_method(Extension, "set_transaction_error", set_transaction_error, 3);
|
210
217
|
rb_define_singleton_method(Extension, "set_transaction_error_data", set_transaction_error_data, 3);
|
211
|
-
rb_define_singleton_method(Extension, "set_transaction_base_data", set_transaction_base_data,
|
218
|
+
rb_define_singleton_method(Extension, "set_transaction_base_data", set_transaction_base_data, 4);
|
212
219
|
rb_define_singleton_method(Extension, "set_transaction_metadata", set_transaction_metadata, 3);
|
213
220
|
rb_define_singleton_method(Extension, "finish_transaction", finish_transaction, 1);
|
214
221
|
|
@@ -219,6 +226,6 @@ void Init_appsignal_extension(void) {
|
|
219
226
|
rb_define_singleton_method(Extension, "increment_counter", increment_counter, 2);
|
220
227
|
rb_define_singleton_method(Extension, "add_distribution_value", add_distribution_value, 2);
|
221
228
|
|
222
|
-
//
|
223
|
-
|
229
|
+
// Event hooks
|
230
|
+
install_event_hooks();
|
224
231
|
}
|
data/lib/appsignal/version.rb
CHANGED