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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a45c15600501200c54adb79600c0ff8c2c7229c6f4c8c6292804f2f10c716e2
4
- data.tar.gz: d068883fec42f88524e0ccac0d84da6941a8c981c6eecb5b7e525affddb3ea77
3
+ metadata.gz: f2182f0bacb1555c0eb3323f8200db7f8d93068f018ce57c82bb4975361d0581
4
+ data.tar.gz: fd8b5694f8cacf2a648bb7a9e4440d16cb70be93c84b17db439781b01f2d5d48
5
5
  SHA512:
6
- metadata.gz: 92c538b493815dd07fed71cf43bf610c109b988a8aa597647e5b0d5c854120c13c9d8f96b8c04740ece120b952327ac920d41d18589422cfd23fe84ee1cded38
7
- data.tar.gz: f69b0f43b36cc020600f91c97aafe3ed523225ac87bb9b62b2764d797e8d40380381b08032303a2d1c54d5a2f02164a8086a1b55bc7ad20d12e5ccf189db2921
6
+ metadata.gz: e44b2bcab8ec4d818faec5b87b4068ce3be0dd37afe97e123c4920cb4d5aa3a931c550bfb80cad1e9d9b6aea6102172cedd68afaee4a1497b3948675f61e2bec
7
+ data.tar.gz: a2e1dd693d0fc1f43e9f68d7a3b019c1d98d879a7671c9bc38944056390d6d8f7e0af6546ec39fc95d568edc3cca12bb73621ffd39e6c6eb80295c6a34cc3c20
data/CHANGELOG.markdown CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 5.7.0
4
+ - Fix native extension compilation with GCC 15 (#552)
5
+ - Handle non Rails/ActiveSupport applications w/ sampling (#557)
6
+
3
7
  # 5.6.5
4
8
  - Improve error capture API (#555)
5
9
  - Add git sha and agent time tracking to error payloads (#554)
@@ -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
- #if defined(RUBY_INTERNAL_EVENT_NEWOBJ) && !defined(_WIN32)
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
- void Init_allocations()
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
- rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
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
-
@@ -1,4 +1,3 @@
1
1
  require 'mkmf'
2
2
 
3
- have_header("ruby/ruby.h") # Needed to check for Ruby <= 1.8.7
4
- create_makefile('allocations')
3
+ create_makefile('allocations')
@@ -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? }
@@ -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.value('ignore').present? ? config.value('ignore') : config.value('ignore_endpoints')
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
 
@@ -1,3 +1,3 @@
1
1
  module ScoutApm
2
- VERSION = "5.6.5"
2
+ VERSION = "5.7.0"
3
3
  end
data/test/test_helper.rb CHANGED
@@ -37,6 +37,11 @@ class FakeConfigOverlay
37
37
  def value(key)
38
38
  @values[key]
39
39
  end
40
+
41
+ def value_present?(key)
42
+ val = value(key)
43
+ val.respond_to?(:empty?) ? !val.empty? : false
44
+ end
40
45
 
41
46
  def values
42
47
  @values
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.5
4
+ version: 5.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes