oboe-heroku 0.9.15.6 → 0.9.16.1
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/lib/oboe-heroku/base.rb +55 -21
- data/lib/oboe-heroku/version.rb +2 -2
- data/lib/oboe-heroku.rb +0 -1
- data/oboe-heroku.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc6c39cb8e4cc43a47e7efbe89d3a8094f32640e
|
4
|
+
data.tar.gz: d1d5f2fe48c8143d07055e9616c030553b7dae3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df68a3e633f1464ff52e27815857dd6200282c4a805a4704bab14231218ea949c051d77f952d88e13eace53e0fe03cf5f3c3d078b173abaf89f80b49ab4afa36
|
7
|
+
data.tar.gz: 42322e7bf47284592a572761f7a8ffef1af8bd3147e07e93c0b1ec97571b7930c418569821f0460cf48d2869647630976a2708db1abd7d5c6df3cfcf77531c91
|
data/lib/oboe-heroku/base.rb
CHANGED
@@ -22,16 +22,21 @@ SAMPLE_SOURCE_MASK = 0b1111000000000000000000000000
|
|
22
22
|
ZERO_SAMPLE_RATE_MASK = 0b1111000000000000000000000000
|
23
23
|
ZERO_SAMPLE_SOURCE_MASK = 0b0000111111111111111111111111
|
24
24
|
|
25
|
+
##
|
26
|
+
# This module is the base module for the various implementations of Oboe reporting.
|
27
|
+
# Current variations as of 2014-09-10 are a c-extension, JRuby (using TraceView Java
|
28
|
+
# instrumentation) and a Heroku c-extension (with embedded tracelyzer)
|
25
29
|
module OboeBase
|
26
30
|
extend ::Oboe::ThreadLocal
|
27
31
|
|
28
32
|
attr_accessor :reporter
|
33
|
+
attr_accessor :collector
|
29
34
|
attr_accessor :loaded
|
30
|
-
|
31
|
-
|
32
|
-
thread_local
|
35
|
+
thread_local :sample_source
|
36
|
+
thread_local :sample_rate
|
37
|
+
thread_local :layer_op
|
33
38
|
|
34
|
-
def self.included(
|
39
|
+
def self.included(_)
|
35
40
|
self.loaded = true
|
36
41
|
end
|
37
42
|
|
@@ -43,26 +48,46 @@ module OboeBase
|
|
43
48
|
end
|
44
49
|
end
|
45
50
|
|
51
|
+
##
|
52
|
+
# Returns true if the tracing_mode is set to always.
|
53
|
+
# False otherwise
|
54
|
+
#
|
46
55
|
def always?
|
47
|
-
Oboe::Config[:tracing_mode].to_s ==
|
56
|
+
Oboe::Config[:tracing_mode].to_s == 'always'
|
48
57
|
end
|
49
58
|
|
59
|
+
##
|
60
|
+
# Returns true if the tracing_mode is set to never.
|
61
|
+
# False otherwise
|
62
|
+
#
|
50
63
|
def never?
|
51
|
-
Oboe::Config[:tracing_mode].to_s ==
|
64
|
+
Oboe::Config[:tracing_mode].to_s == 'never'
|
52
65
|
end
|
53
66
|
|
67
|
+
##
|
68
|
+
# Returns true if the tracing_mode is set to always or through.
|
69
|
+
# False otherwise
|
70
|
+
#
|
54
71
|
def passthrough?
|
55
|
-
|
72
|
+
%w(always through).include?(Oboe::Config[:tracing_mode])
|
56
73
|
end
|
57
74
|
|
75
|
+
##
|
76
|
+
# Returns true if the tracing_mode is set to through.
|
77
|
+
# False otherwise
|
78
|
+
#
|
58
79
|
def through?
|
59
|
-
Oboe::Config[:tracing_mode] ==
|
80
|
+
Oboe::Config[:tracing_mode] == 'through'
|
60
81
|
end
|
61
82
|
|
83
|
+
##
|
84
|
+
# Returns true if we are currently tracing a request
|
85
|
+
# False otherwise
|
86
|
+
#
|
62
87
|
def tracing?
|
63
88
|
return false unless Oboe.loaded
|
64
89
|
|
65
|
-
Oboe::Context.isValid
|
90
|
+
Oboe::Context.isValid && !Oboe.never?
|
66
91
|
end
|
67
92
|
|
68
93
|
def log(layer, label, options = {})
|
@@ -71,36 +96,45 @@ module OboeBase
|
|
71
96
|
end
|
72
97
|
|
73
98
|
def heroku?
|
74
|
-
|
99
|
+
ENV['TRACEVIEW_URL']
|
75
100
|
end
|
76
101
|
|
102
|
+
##
|
103
|
+
# Determines if we are running under a forking webserver
|
104
|
+
#
|
77
105
|
def forking_webserver?
|
78
|
-
(defined?(::Unicorn)
|
106
|
+
(defined?(::Unicorn) && ($PROGRAM_NAME =~ /unicorn/i)) ? true : false
|
107
|
+
end
|
108
|
+
|
109
|
+
##
|
110
|
+
# Indicates whether a supported framework is in use
|
111
|
+
# or not
|
112
|
+
#
|
113
|
+
def framework?
|
114
|
+
defined?(::Rails) or defined?(::Sinatra) or defined?(::Padrino) or defined?(::Grape)
|
79
115
|
end
|
80
116
|
|
81
117
|
##
|
82
118
|
# These methods should be implemented by the descendants
|
83
119
|
# (Oboe_metal, Oboe_metal (JRuby), Heroku_metal)
|
84
120
|
#
|
85
|
-
def sample?(
|
86
|
-
|
121
|
+
def sample?(_opts = {})
|
122
|
+
fail 'sample? should be implemented by metal layer.'
|
87
123
|
end
|
88
124
|
|
89
|
-
def log(
|
90
|
-
|
125
|
+
def log(_layer, _label, _options = {})
|
126
|
+
fail 'log should be implemented by metal layer.'
|
91
127
|
end
|
92
128
|
|
93
|
-
def set_tracing_mode(
|
94
|
-
|
129
|
+
def set_tracing_mode(_mode)
|
130
|
+
fail 'set_tracing_mode should be implemented by metal layer.'
|
95
131
|
end
|
96
132
|
|
97
|
-
def set_sample_rate(
|
98
|
-
|
133
|
+
def set_sample_rate(_rate)
|
134
|
+
fail 'set_sample_rate should be implemented by metal layer.'
|
99
135
|
end
|
100
|
-
|
101
136
|
end
|
102
137
|
|
103
138
|
module Oboe
|
104
139
|
extend OboeBase
|
105
140
|
end
|
106
|
-
|
data/lib/oboe-heroku/version.rb
CHANGED
data/lib/oboe-heroku.rb
CHANGED
data/oboe-heroku.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oboe-heroku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Giacomo Lombardo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oboe
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 2.7.
|
20
|
+
version: 2.7.2.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 2.7.
|
27
|
+
version: 2.7.2.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|