scout_apm 5.6.5 → 5.7.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +4 -0
- data/ext/allocations/allocations.c +20 -33
- data/ext/allocations/extconf.rb +1 -2
- data/lib/scout_apm/config.rb +6 -0
- data/lib/scout_apm/sampling.rb +1 -1
- data/lib/scout_apm/version.rb +1 -1
- data/test/test_helper.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2182f0bacb1555c0eb3323f8200db7f8d93068f018ce57c82bb4975361d0581
|
4
|
+
data.tar.gz: fd8b5694f8cacf2a648bb7a9e4440d16cb70be93c84b17db439781b01f2d5d48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e44b2bcab8ec4d818faec5b87b4068ce3be0dd37afe97e123c4920cb4d5aa3a931c550bfb80cad1e9d9b6aea6102172cedd68afaee4a1497b3948675f61e2bec
|
7
|
+
data.tar.gz: a2e1dd693d0fc1f43e9f68d7a3b019c1d98d879a7671c9bc38944056390d6d8f7e0af6546ec39fc95d568edc3cca12bb73621ffd39e6c6eb80295c6a34cc3c20
|
data/CHANGELOG.markdown
CHANGED
@@ -1,26 +1,38 @@
|
|
1
|
-
#ifdef HAVE_RUBY_RUBY_H
|
2
|
-
#include <ruby/ruby.h>
|
3
|
-
#else // Ruby <= 1.8.7
|
4
1
|
#include <ruby.h>
|
5
|
-
#endif
|
6
2
|
|
7
3
|
VALUE mScoutApm;
|
8
4
|
VALUE mInstruments;
|
9
5
|
VALUE cAllocations;
|
10
6
|
|
11
|
-
#
|
7
|
+
#ifdef _WIN32
|
8
|
+
|
9
|
+
#define ALLOCATIONS_ENABLED Qfalse
|
10
|
+
|
11
|
+
static VALUE
|
12
|
+
get_allocation_count(VALUE klass) {
|
13
|
+
return ULL2NUM(0);
|
14
|
+
}
|
15
|
+
|
16
|
+
void
|
17
|
+
Init_hooks(VALUE module)
|
18
|
+
{
|
19
|
+
}
|
20
|
+
|
21
|
+
#else // _WIN32
|
12
22
|
|
13
23
|
#include <sys/resource.h> // is this needed?
|
14
24
|
#include <sys/time.h>
|
15
25
|
#include <ruby/debug.h>
|
16
26
|
|
27
|
+
#define ALLOCATIONS_ENABLED Qtrue
|
28
|
+
|
17
29
|
static __thread uint64_t endpoint_allocations;
|
18
30
|
void increment_allocations() {
|
19
31
|
endpoint_allocations++;
|
20
32
|
}
|
21
33
|
|
22
34
|
static VALUE
|
23
|
-
get_allocation_count() {
|
35
|
+
get_allocation_count(VALUE klass) {
|
24
36
|
return ULL2NUM(endpoint_allocations);
|
25
37
|
}
|
26
38
|
|
@@ -50,28 +62,7 @@ Init_hooks(VALUE module)
|
|
50
62
|
set_gc_hook(RUBY_INTERNAL_EVENT_NEWOBJ);
|
51
63
|
}
|
52
64
|
|
53
|
-
|
54
|
-
{
|
55
|
-
mScoutApm = rb_define_module("ScoutApm");
|
56
|
-
mInstruments = rb_define_module_under(mScoutApm, "Instruments");
|
57
|
-
cAllocations = rb_define_class_under(mInstruments, "Allocations", rb_cObject);
|
58
|
-
rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
|
59
|
-
rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
|
60
|
-
rb_define_const(cAllocations, "ENABLED", Qtrue);
|
61
|
-
Init_hooks(mScoutApm);
|
62
|
-
}
|
63
|
-
|
64
|
-
#else
|
65
|
-
|
66
|
-
static VALUE
|
67
|
-
get_allocation_count() {
|
68
|
-
return ULL2NUM(0);
|
69
|
-
}
|
70
|
-
|
71
|
-
void
|
72
|
-
Init_hooks(VALUE module)
|
73
|
-
{
|
74
|
-
}
|
65
|
+
#endif // _WIN32
|
75
66
|
|
76
67
|
void Init_allocations()
|
77
68
|
{
|
@@ -79,10 +70,6 @@ void Init_allocations()
|
|
79
70
|
mInstruments = rb_define_module_under(mScoutApm, "Instruments");
|
80
71
|
cAllocations = rb_define_class_under(mInstruments, "Allocations", rb_cObject);
|
81
72
|
rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
|
82
|
-
|
83
|
-
rb_define_const(cAllocations, "ENABLED", Qfalse);
|
73
|
+
rb_define_const(cAllocations, "ENABLED", ALLOCATIONS_ENABLED);
|
84
74
|
Init_hooks(mScoutApm);
|
85
75
|
}
|
86
|
-
|
87
|
-
#endif //#ifdef RUBY_INTERNAL_EVENT_NEWOBJ
|
88
|
-
|
data/ext/allocations/extconf.rb
CHANGED
data/lib/scout_apm/config.rb
CHANGED
@@ -290,6 +290,12 @@ module ScoutApm
|
|
290
290
|
coercion.coerce(raw_value)
|
291
291
|
end
|
292
292
|
|
293
|
+
# https://github.com/rails/rails/blob/aca037411eab504a48c41472e696547da1543a19/activesupport/lib/active_support/core_ext/object/blank.rb#L25
|
294
|
+
def value_present?(key)
|
295
|
+
val = value(key)
|
296
|
+
val.respond_to?(:empty?) ? !val.empty? : false
|
297
|
+
end
|
298
|
+
|
293
299
|
# Did we load anything for configuration?
|
294
300
|
def any_keys_found?
|
295
301
|
@overlays.any? { |overlay| overlay.any_keys_found? }
|
data/lib/scout_apm/sampling.rb
CHANGED
@@ -8,7 +8,7 @@ module ScoutApm
|
|
8
8
|
# jobs matched explicitly by name
|
9
9
|
|
10
10
|
# for now still support old config key ('ignore') for backwards compatibility
|
11
|
-
@ignore_endpoints = config.
|
11
|
+
@ignore_endpoints = config.value_present?('ignore') ? config.value('ignore') : config.value('ignore_endpoints')
|
12
12
|
@sample_endpoints = individual_sample_to_hash(config.value('sample_endpoints'))
|
13
13
|
@endpoint_sample_rate = config.value('endpoint_sample_rate')
|
14
14
|
|
data/lib/scout_apm/version.rb
CHANGED
data/test/test_helper.rb
CHANGED