instrument_all_the_things 1.0.1 → 1.0.2
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/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/instrument_all_the_things.gemspec +0 -1
- data/lib/instrument_all_the_things.rb +1 -1
- data/lib/instrument_all_the_things/instrumentors/error_logging.rb +1 -1
- data/lib/instrument_all_the_things/instrumentors/gc_stats.rb +2 -2
- data/lib/instrument_all_the_things/method_instrumentor.rb +7 -4
- data/lib/instrument_all_the_things/testing/rspec_matchers.rb +8 -8
- data/lib/instrument_all_the_things/version.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bcc57ca40a267c78c39c37d55711d1ca2ca33637c115b293e9f679b5950b6e7
|
4
|
+
data.tar.gz: 720d12fbd72e5c7bb7b82f9088c882037cc6c2ba675f3f7c097bfcfdb03771e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a99e6d00c90458e247bb4a018d2abd23774aec7d2c660bdad9e0e6e22dc9b29058e2d605f4dd0fa126084bb2163721fb1e2e8670b1521c488718d3e1d225010
|
7
|
+
data.tar.gz: 9e9ea9639a45dd1f766882bb2ae355a4e9029a388a9421849d681389d8595de5f7cf81ac38f7648add79b4db7582320bc33ccdf057cc352e6634b6ee8c392dad
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Or install it yourself as:
|
|
23
23
|
$ gem install instrument_all_the_things
|
24
24
|
|
25
25
|
## Usage
|
26
|
-
*Note:* For convenience the InstrumentAllTheThings constant is aliased to IATT.
|
26
|
+
*Note:* For convenience the InstrumentAllTheThings constant is aliased to IATT unless the constant is already defined.
|
27
27
|
|
28
28
|
|
29
29
|
## Method Instrumentation
|
@@ -368,4 +368,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
368
368
|
|
369
369
|
## Contributing
|
370
370
|
|
371
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
371
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/GetTerminus/instrument_all_the_things.
|
@@ -22,7 +22,7 @@ module InstrumentAllTheThings
|
|
22
22
|
end
|
23
23
|
|
24
24
|
report_value = proc do |klass, stat_name, value|
|
25
|
-
|
25
|
+
InstrumentAllTheThings.stat_reporter.histogram(
|
26
26
|
context.stats_name(klass) + ".#{stat_name}_change",
|
27
27
|
value
|
28
28
|
)
|
@@ -37,7 +37,7 @@ module InstrumentAllTheThings
|
|
37
37
|
new_value - starting_value
|
38
38
|
end
|
39
39
|
|
40
|
-
if (span =
|
40
|
+
if (span = InstrumentAllTheThings.tracer.active_span)
|
41
41
|
span.set_tag('gc_stats', diff)
|
42
42
|
end
|
43
43
|
|
@@ -4,17 +4,20 @@ require_relative './instrumentors/all'
|
|
4
4
|
|
5
5
|
module InstrumentAllTheThings
|
6
6
|
class MethodInstrumentor
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
WRAPPERS = {
|
8
|
+
# Note that the order of these hash keys are applied top to bottom, with the first inserted key
|
9
|
+
# being the inner most wrapper
|
10
10
|
gc_stats: Instrumentors::GC_STATS_WRAPPER,
|
11
|
+
error_logging: Instrumentors::ERROR_LOGGING_WRAPPER,
|
11
12
|
execution_counts_and_timing: Instrumentors::EXECUTION_COUNT_AND_TIMING_WRAPPER,
|
13
|
+
trace: Instrumentors::TRACE_WRAPPER,
|
12
14
|
}.freeze
|
13
15
|
|
14
16
|
DEFAULT_OPTIONS = {
|
15
17
|
trace: true,
|
16
18
|
gc_stats: true,
|
17
19
|
error_logging: true,
|
20
|
+
execution_counts_and_timing: true
|
18
21
|
}.freeze
|
19
22
|
|
20
23
|
attr_accessor :options, :instrumentor
|
@@ -28,7 +31,7 @@ module InstrumentAllTheThings
|
|
28
31
|
end
|
29
32
|
|
30
33
|
def build_instrumentor
|
31
|
-
procs =
|
34
|
+
procs = WRAPPERS.collect do |type, builder|
|
32
35
|
next unless options[type]
|
33
36
|
|
34
37
|
builder.call(options[type], options[:context])
|
@@ -4,12 +4,12 @@ module InstrumentAllTheThings
|
|
4
4
|
module Testing
|
5
5
|
module RSpecMatchers
|
6
6
|
def histogram_value(counter_name)
|
7
|
-
stats =
|
7
|
+
stats = InstrumentAllTheThings.stat_reporter.emitted_values[:histogram][counter_name]
|
8
8
|
stats.inject(0){|l, n| l + n[:args][0] }
|
9
9
|
end
|
10
10
|
|
11
11
|
def distribution_values(distribution_name, with_tags: nil)
|
12
|
-
stats =
|
12
|
+
stats = InstrumentAllTheThings.stat_reporter.emitted_values[:distribution][distribution_name]
|
13
13
|
|
14
14
|
if with_tags && !stats.empty?
|
15
15
|
stats = stats.select do |s|
|
@@ -21,7 +21,7 @@ module InstrumentAllTheThings
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def histogram_values(histogram_name, with_tags: nil)
|
24
|
-
stats =
|
24
|
+
stats = InstrumentAllTheThings.stat_reporter.emitted_values[:histogram][histogram_name]
|
25
25
|
|
26
26
|
if with_tags && !stats.empty?
|
27
27
|
stats = stats.select do |s|
|
@@ -33,7 +33,7 @@ module InstrumentAllTheThings
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def timing_values(timing_name, with_tags: nil)
|
36
|
-
stats =
|
36
|
+
stats = InstrumentAllTheThings.stat_reporter.emitted_values[:timing][timing_name]
|
37
37
|
|
38
38
|
if with_tags && !stats.empty?
|
39
39
|
stats = stats.select do |s|
|
@@ -45,7 +45,7 @@ module InstrumentAllTheThings
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def set_value(counter_name, with_tags: nil)
|
48
|
-
stats =
|
48
|
+
stats = InstrumentAllTheThings.stat_reporter.emitted_values[:set][counter_name]
|
49
49
|
|
50
50
|
if with_tags && !stats.empty?
|
51
51
|
stats = stats.select do |s|
|
@@ -58,7 +58,7 @@ module InstrumentAllTheThings
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def gauge_value(counter_name, with_tags: nil)
|
61
|
-
stats =
|
61
|
+
stats = InstrumentAllTheThings.stat_reporter.emitted_values[:gauge][counter_name]
|
62
62
|
|
63
63
|
if with_tags && !stats.empty?
|
64
64
|
stats = stats.select do |s|
|
@@ -69,7 +69,7 @@ module InstrumentAllTheThings
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def counter_value(counter_name, with_tags: nil)
|
72
|
-
stats =
|
72
|
+
stats = InstrumentAllTheThings.stat_reporter.emitted_values[:count][counter_name]
|
73
73
|
if with_tags && !stats.empty?
|
74
74
|
stats = stats.select do |s|
|
75
75
|
with_tags.all?{|t| s[:tags].include?(t) }
|
@@ -84,7 +84,7 @@ module InstrumentAllTheThings
|
|
84
84
|
|
85
85
|
def emitted_spans(filtered_by: nil)
|
86
86
|
sleep 0.01
|
87
|
-
traces =
|
87
|
+
traces = InstrumentAllTheThings::Testing::TraceTracker.tracker.traces.map(&:dup)
|
88
88
|
if filtered_by
|
89
89
|
filtered_by.transform_keys!(&:to_s)
|
90
90
|
traces.select! { |t| filtered_by < t }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instrument_all_the_things
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Malinconico
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ddtrace
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
|
-
rubygems_version: 3.
|
223
|
+
rubygems_version: 3.1.2
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: Make instrumentation with DataDog easy peasy
|