appoptics_apm 4.0.3 → 4.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile_test +6 -7
- data/README.md +3 -3
- data/Rakefile +3 -2
- data/appoptics_apm.gemspec +2 -2
- data/docker-compose.yml +0 -22
- data/ext/oboe_metal/extconf.rb +4 -0
- data/lib/appoptics_apm/config.rb +11 -6
- data/lib/appoptics_apm/version.rb +1 -1
- metadata +3 -202
- data/gemfiles/delayed_job.gemfile +0 -36
- data/gemfiles/frameworks.gemfile +0 -44
- data/gemfiles/instrumentation_mocked.gemfile +0 -29
- data/gemfiles/libraries.gemfile +0 -85
- data/gemfiles/noop.gemfile +0 -17
- data/gemfiles/rails23.gemfile +0 -39
- data/gemfiles/rails30.gemfile +0 -42
- data/gemfiles/rails31.gemfile +0 -44
- data/gemfiles/rails32.gemfile +0 -54
- data/gemfiles/rails40.gemfile +0 -27
- data/gemfiles/rails41.gemfile +0 -27
- data/gemfiles/rails42.gemfile +0 -35
- data/gemfiles/rails50.gemfile +0 -44
- data/gemfiles/rails51.gemfile +0 -44
- data/test/benchmark/README.md +0 -65
- data/test/benchmark/logging_bench.rb +0 -54
- data/test/benchmark/with_libraries_gemfile/bunny_bench.rb +0 -69
- data/test/benchmark/with_rails5x_gemfile/action_controller5x_bench.rb +0 -43
- data/test/frameworks/apps/grape_nested.rb +0 -33
- data/test/frameworks/apps/grape_simple.rb +0 -80
- data/test/frameworks/apps/padrino_simple.rb +0 -80
- data/test/frameworks/apps/sinatra_simple.rb +0 -55
- data/test/frameworks/grape_test.rb +0 -286
- data/test/frameworks/padrino_test.rb +0 -222
- data/test/frameworks/rails3x_test.rb +0 -554
- data/test/frameworks/rails4x_test.rb +0 -570
- data/test/frameworks/rails5x_api_test.rb +0 -210
- data/test/frameworks/rails5x_test.rb +0 -376
- data/test/frameworks/rails_shared_tests.rb +0 -172
- data/test/frameworks/sinatra_test.rb +0 -140
- data/test/instrumentation/bunny_client_test.rb +0 -276
- data/test/instrumentation/bunny_consumer_test.rb +0 -204
- data/test/instrumentation/curb_test.rb +0 -398
- data/test/instrumentation/dalli_test.rb +0 -177
- data/test/instrumentation/em_http_request_test.rb +0 -89
- data/test/instrumentation/excon_test.rb +0 -231
- data/test/instrumentation/faraday_test.rb +0 -228
- data/test/instrumentation/http_test.rb +0 -143
- data/test/instrumentation/httpclient_test.rb +0 -304
- data/test/instrumentation/memcache_test.rb +0 -260
- data/test/instrumentation/memcached_test.rb +0 -229
- data/test/instrumentation/mongo_v1_test.rb +0 -479
- data/test/instrumentation/mongo_v2_index_test.rb +0 -124
- data/test/instrumentation/mongo_v2_test.rb +0 -584
- data/test/instrumentation/mongo_v2_view_test.rb +0 -435
- data/test/instrumentation/moped_test.rb +0 -517
- data/test/instrumentation/rack_test.rb +0 -165
- data/test/instrumentation/redis_hashes_test.rb +0 -268
- data/test/instrumentation/redis_keys_test.rb +0 -321
- data/test/instrumentation/redis_lists_test.rb +0 -310
- data/test/instrumentation/redis_misc_test.rb +0 -163
- data/test/instrumentation/redis_sets_test.rb +0 -296
- data/test/instrumentation/redis_sortedsets_test.rb +0 -328
- data/test/instrumentation/redis_strings_test.rb +0 -349
- data/test/instrumentation/resque_test.rb +0 -185
- data/test/instrumentation/rest-client_test.rb +0 -288
- data/test/instrumentation/sequel_mysql2_test.rb +0 -353
- data/test/instrumentation/sequel_mysql_test.rb +0 -334
- data/test/instrumentation/sequel_pg_test.rb +0 -336
- data/test/instrumentation/sidekiq-client_test.rb +0 -159
- data/test/instrumentation/sidekiq-worker_test.rb +0 -180
- data/test/instrumentation/twitter-cassandra_test.rb +0 -424
- data/test/instrumentation/typhoeus_test.rb +0 -284
- data/test/jobs/delayed_job/db_worker_job.rb +0 -29
- data/test/jobs/delayed_job/error_worker_job.rb +0 -10
- data/test/jobs/delayed_job/remote_call_worker_job.rb +0 -20
- data/test/jobs/resque/db_worker_job.rb +0 -29
- data/test/jobs/resque/error_worker_job.rb +0 -10
- data/test/jobs/resque/remote_call_worker_job.rb +0 -20
- data/test/jobs/sidekiq/db_worker_job.rb +0 -29
- data/test/jobs/sidekiq/error_worker_job.rb +0 -10
- data/test/jobs/sidekiq/remote_call_worker_job.rb +0 -20
- data/test/minitest_helper.rb +0 -277
- data/test/mocked/curb_mocked_test.rb +0 -324
- data/test/mocked/excon_mocked_test.rb +0 -174
- data/test/mocked/faraday_mocked_test.rb +0 -97
- data/test/mocked/http_mocked_test.rb +0 -135
- data/test/mocked/httpclient_mocked_test.rb +0 -258
- data/test/mocked/rest_client_mocked_test.rb +0 -109
- data/test/mocked/typhoeus_mocked_test.rb +0 -207
- data/test/models/widget.rb +0 -36
- data/test/noop/noop_test.rb +0 -145
- data/test/profiling/legacy_method_profiling_test.rb +0 -201
- data/test/profiling/method_profiling_test.rb +0 -631
- data/test/queues/delayed_job-client_test.rb +0 -95
- data/test/queues/delayed_job-worker_test.rb +0 -91
- data/test/reporter/reporter_test.rb +0 -14
- data/test/servers/delayed_job.rb +0 -107
- data/test/servers/rackapp_8101.rb +0 -29
- data/test/servers/rails3x_8140.rb +0 -96
- data/test/servers/rails4x_8140.rb +0 -96
- data/test/servers/rails5x_8140.rb +0 -95
- data/test/servers/rails5x_api_8150.rb +0 -78
- data/test/servers/sidekiq.rb +0 -29
- data/test/servers/sidekiq.yml +0 -7
- data/test/servers/sidekiq_initializer.rb +0 -25
- data/test/settings +0 -0
- data/test/support/auto_tracing_test.rb +0 -50
- data/test/support/backcompat_test.rb +0 -276
- data/test/support/config_test.rb +0 -149
- data/test/support/dnt_test.rb +0 -98
- data/test/support/init_report_test.rb +0 -25
- data/test/support/liboboe_settings_test.rb +0 -110
- data/test/support/logging_test.rb +0 -130
- data/test/support/sql_sanitize_test.rb +0 -55
- data/test/support/tracing_mode_test.rb +0 -33
- data/test/support/tvalias_test.rb +0 -15
- data/test/support/xtrace_test.rb +0 -41
@@ -1,284 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
require 'minitest_helper'
|
5
|
-
require 'rack'
|
6
|
-
|
7
|
-
describe "Typhoeus" do
|
8
|
-
before do
|
9
|
-
clear_all_traces
|
10
|
-
@collect_backtraces = AppOpticsAPM::Config[:typhoeus][:collect_backtraces]
|
11
|
-
@log_args = AppOpticsAPM::Config[:typhoeus][:log_args]
|
12
|
-
end
|
13
|
-
|
14
|
-
after do
|
15
|
-
AppOpticsAPM::Config[:typhoeus][:collect_backtraces] = @collect_backtraces
|
16
|
-
AppOpticsAPM::Config[:typhoeus][:log_args] = @log_args
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'Typhoeus should be defined and ready' do
|
20
|
-
defined?(::Typhoeus::Request::Operations).wont_match nil
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'Typhoeus should have appoptics_apm methods defined' do
|
24
|
-
[ :run_with_appoptics ].each do |m|
|
25
|
-
::Typhoeus::Request::Operations.method_defined?(m).must_equal true
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'should trace a typhoeus request' do
|
30
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
31
|
-
Typhoeus.get("http://127.0.0.1:8101/")
|
32
|
-
end
|
33
|
-
|
34
|
-
traces = get_all_traces
|
35
|
-
traces.count.must_equal 8
|
36
|
-
|
37
|
-
valid_edges?(traces).must_equal true
|
38
|
-
validate_outer_layers(traces, 'typhoeus_test')
|
39
|
-
|
40
|
-
traces[1]['Layer'].must_equal 'typhoeus'
|
41
|
-
traces[1].key?('Backtrace').must_equal AppOpticsAPM::Config[:typhoeus][:collect_backtraces]
|
42
|
-
|
43
|
-
traces[5]['Layer'].must_equal 'typhoeus'
|
44
|
-
traces[5]['Label'].must_equal 'info'
|
45
|
-
traces[5]['IsService'].must_equal 1
|
46
|
-
traces[5]['RemoteURL'].must_equal 'http://127.0.0.1:8101/'
|
47
|
-
traces[5]['HTTPMethod'].must_equal 'GET'
|
48
|
-
traces[5]['HTTPStatus'].must_equal 200
|
49
|
-
|
50
|
-
traces[6]['Layer'].must_equal 'typhoeus'
|
51
|
-
traces[6]['Label'].must_equal 'exit'
|
52
|
-
end
|
53
|
-
|
54
|
-
it 'should trace a typhoeus POST request' do
|
55
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
56
|
-
Typhoeus.post("127.0.0.1:8101/",
|
57
|
-
:body => { :key => "appoptics-ruby-fake", :content => "appoptics-ruby repo test suite"})
|
58
|
-
end
|
59
|
-
|
60
|
-
traces = get_all_traces
|
61
|
-
traces.count.must_equal 8
|
62
|
-
|
63
|
-
valid_edges?(traces).must_equal true
|
64
|
-
validate_outer_layers(traces, 'typhoeus_test')
|
65
|
-
|
66
|
-
traces[1]['Layer'].must_equal 'typhoeus'
|
67
|
-
traces[1].key?('Backtrace').must_equal AppOpticsAPM::Config[:typhoeus][:collect_backtraces]
|
68
|
-
|
69
|
-
traces[5]['Layer'].must_equal 'typhoeus'
|
70
|
-
traces[5]['Label'].must_equal 'info'
|
71
|
-
traces[5]['IsService'].must_equal 1
|
72
|
-
traces[5]['RemoteURL'].casecmp('http://127.0.0.1:8101/').must_equal 0
|
73
|
-
traces[5]['HTTPMethod'].must_equal 'POST'
|
74
|
-
traces[5]['HTTPStatus'].must_equal 200
|
75
|
-
|
76
|
-
traces[6]['Layer'].must_equal 'typhoeus'
|
77
|
-
traces[6]['Label'].must_equal 'exit'
|
78
|
-
end
|
79
|
-
|
80
|
-
it 'should trace a typhoeus PUT request' do
|
81
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
82
|
-
Typhoeus.put("http://127.0.0.1:8101/",
|
83
|
-
:body => { :key => "appoptics-ruby-fake", :content => "appoptics-ruby repo test suite"})
|
84
|
-
end
|
85
|
-
|
86
|
-
traces = get_all_traces
|
87
|
-
traces.count.must_equal 8
|
88
|
-
|
89
|
-
valid_edges?(traces).must_equal true
|
90
|
-
validate_outer_layers(traces, 'typhoeus_test')
|
91
|
-
|
92
|
-
traces[1]['Layer'].must_equal 'typhoeus'
|
93
|
-
traces[1].key?('Backtrace').must_equal AppOpticsAPM::Config[:typhoeus][:collect_backtraces]
|
94
|
-
|
95
|
-
traces[5]['Layer'].must_equal 'typhoeus'
|
96
|
-
traces[5]['Label'].must_equal 'info'
|
97
|
-
traces[5]['IsService'].must_equal 1
|
98
|
-
traces[5]['RemoteURL'].must_equal 'http://127.0.0.1:8101/'
|
99
|
-
traces[5]['HTTPMethod'].must_equal 'PUT'
|
100
|
-
traces[5]['HTTPStatus'].must_equal 200
|
101
|
-
|
102
|
-
traces[6]['Layer'].must_equal 'typhoeus'
|
103
|
-
traces[6]['Label'].must_equal 'exit'
|
104
|
-
end
|
105
|
-
|
106
|
-
it 'should trace a typhoeus DELETE request' do
|
107
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
108
|
-
Typhoeus.delete("http://127.0.0.1:8101/")
|
109
|
-
end
|
110
|
-
|
111
|
-
traces = get_all_traces
|
112
|
-
traces.count.must_equal 8
|
113
|
-
|
114
|
-
valid_edges?(traces).must_equal true
|
115
|
-
validate_outer_layers(traces, 'typhoeus_test')
|
116
|
-
|
117
|
-
traces[1]['Layer'].must_equal 'typhoeus'
|
118
|
-
traces[1].key?('Backtrace').must_equal AppOpticsAPM::Config[:typhoeus][:collect_backtraces]
|
119
|
-
|
120
|
-
traces[5]['Layer'].must_equal 'typhoeus'
|
121
|
-
traces[5]['Label'].must_equal 'info'
|
122
|
-
traces[5]['IsService'].must_equal 1
|
123
|
-
traces[5]['RemoteURL'].must_equal 'http://127.0.0.1:8101/'
|
124
|
-
traces[5]['HTTPMethod'].must_equal 'DELETE'
|
125
|
-
traces[5]['HTTPStatus'].must_equal 200
|
126
|
-
|
127
|
-
traces[6]['Layer'].must_equal 'typhoeus'
|
128
|
-
traces[6]['Label'].must_equal 'exit'
|
129
|
-
end
|
130
|
-
|
131
|
-
it 'should trace a typhoeus HEAD request' do
|
132
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
133
|
-
Typhoeus.head("http://127.0.0.1:8101/")
|
134
|
-
end
|
135
|
-
|
136
|
-
traces = get_all_traces
|
137
|
-
traces.count.must_equal 8
|
138
|
-
|
139
|
-
valid_edges?(traces).must_equal true
|
140
|
-
validate_outer_layers(traces, 'typhoeus_test')
|
141
|
-
|
142
|
-
traces[1]['Layer'].must_equal 'typhoeus'
|
143
|
-
traces[1].key?('Backtrace').must_equal AppOpticsAPM::Config[:typhoeus][:collect_backtraces]
|
144
|
-
|
145
|
-
traces[5]['Layer'].must_equal 'typhoeus'
|
146
|
-
traces[5]['Label'].must_equal 'info'
|
147
|
-
traces[5]['IsService'].must_equal 1
|
148
|
-
traces[5]['RemoteURL'].must_equal 'http://127.0.0.1:8101/'
|
149
|
-
traces[5]['HTTPMethod'].must_equal 'HEAD'
|
150
|
-
traces[5]['HTTPStatus'].must_equal 200
|
151
|
-
|
152
|
-
traces[6]['Layer'].must_equal 'typhoeus'
|
153
|
-
traces[6]['Label'].must_equal 'exit'
|
154
|
-
end
|
155
|
-
|
156
|
-
it 'should trace a typhoeus GET request to an instr\'d app' do
|
157
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
158
|
-
Typhoeus.get("127.0.0.1:8101/")
|
159
|
-
end
|
160
|
-
|
161
|
-
traces = get_all_traces
|
162
|
-
traces.count.must_equal 8
|
163
|
-
|
164
|
-
valid_edges?(traces).must_equal true
|
165
|
-
validate_outer_layers(traces, 'typhoeus_test')
|
166
|
-
|
167
|
-
traces[1]['Layer'].must_equal 'typhoeus'
|
168
|
-
traces[1].key?('Backtrace').must_equal AppOpticsAPM::Config[:typhoeus][:collect_backtraces]
|
169
|
-
|
170
|
-
traces[5]['Layer'].must_equal 'typhoeus'
|
171
|
-
traces[5]['Label'].must_equal 'info'
|
172
|
-
traces[5]['IsService'].must_equal 1
|
173
|
-
traces[5]['RemoteURL'].casecmp('http://127.0.0.1:8101/').must_equal 0
|
174
|
-
traces[5]['HTTPMethod'].must_equal 'GET'
|
175
|
-
traces[5]['HTTPStatus'].must_equal 200
|
176
|
-
|
177
|
-
traces[6]['Layer'].must_equal 'typhoeus'
|
178
|
-
traces[6]['Label'].must_equal 'exit'
|
179
|
-
end
|
180
|
-
|
181
|
-
it 'should trace a typhoeus GET request with DNS error' do
|
182
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
183
|
-
Typhoeus.get("thisdomaindoesntexisthopefully.asdf/products/appoptics_apm/")
|
184
|
-
end
|
185
|
-
|
186
|
-
traces = get_all_traces
|
187
|
-
traces.count.must_equal 6
|
188
|
-
|
189
|
-
valid_edges?(traces).must_equal true
|
190
|
-
validate_outer_layers(traces, 'typhoeus_test')
|
191
|
-
|
192
|
-
traces[1]['Layer'].must_equal 'typhoeus'
|
193
|
-
traces[1].key?('Backtrace').must_equal AppOpticsAPM::Config[:typhoeus][:collect_backtraces]
|
194
|
-
|
195
|
-
traces[2]['Layer'].must_equal 'typhoeus'
|
196
|
-
traces[2]['Label'].must_equal 'error'
|
197
|
-
|
198
|
-
traces[3]['Layer'].must_equal 'typhoeus'
|
199
|
-
traces[3]['Label'].must_equal 'info'
|
200
|
-
traces[3]['IsService'].must_equal 1
|
201
|
-
traces[3]['RemoteURL'].casecmp('http://thisdomaindoesntexisthopefully.asdf/products/appoptics_apm/').must_equal 0
|
202
|
-
traces[3]['HTTPMethod'].must_equal 'GET'
|
203
|
-
traces[3]['HTTPStatus'].must_equal 0
|
204
|
-
|
205
|
-
traces[3]['Layer'].must_equal 'typhoeus'
|
206
|
-
traces[3]['Label'].must_equal 'info'
|
207
|
-
|
208
|
-
traces[4]['Layer'].must_equal 'typhoeus'
|
209
|
-
traces[4]['Label'].must_equal 'exit'
|
210
|
-
end
|
211
|
-
|
212
|
-
it 'should trace parallel typhoeus requests' do
|
213
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
214
|
-
hydra = Typhoeus::Hydra.hydra
|
215
|
-
|
216
|
-
first_request = Typhoeus::Request.new("127.0.0.1:8101/products/appoptics_apm/")
|
217
|
-
second_request = Typhoeus::Request.new("127.0.0.1:8101/products/")
|
218
|
-
third_request = Typhoeus::Request.new("127.0.0.1:8101/")
|
219
|
-
|
220
|
-
hydra.queue first_request
|
221
|
-
hydra.queue second_request
|
222
|
-
hydra.queue third_request
|
223
|
-
|
224
|
-
hydra.run
|
225
|
-
end
|
226
|
-
|
227
|
-
traces = get_all_traces
|
228
|
-
traces.count.must_equal 13
|
229
|
-
|
230
|
-
valid_edges?(traces).must_equal true
|
231
|
-
validate_outer_layers(traces, 'typhoeus_test')
|
232
|
-
|
233
|
-
traces[1]['Layer'].must_equal 'typhoeus_hydra'
|
234
|
-
traces[1]['Label'].must_equal 'entry'
|
235
|
-
traces[1]['Async'].must_equal 1
|
236
|
-
|
237
|
-
traces[11]['Layer'].must_equal 'typhoeus_hydra'
|
238
|
-
traces[11]['Label'].must_equal 'exit'
|
239
|
-
end
|
240
|
-
|
241
|
-
it 'should obey :log_args setting when true' do
|
242
|
-
AppOpticsAPM::Config[:typhoeus][:log_args] = true
|
243
|
-
|
244
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
245
|
-
Typhoeus.get("127.0.0.1:8101/?blah=1")
|
246
|
-
end
|
247
|
-
|
248
|
-
traces = get_all_traces
|
249
|
-
traces[5]['RemoteURL'].casecmp('http://127.0.0.1:8101/?blah=1').must_equal 0
|
250
|
-
end
|
251
|
-
|
252
|
-
it 'should obey :log_args setting when false' do
|
253
|
-
AppOpticsAPM::Config[:typhoeus][:log_args] = false
|
254
|
-
|
255
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
256
|
-
Typhoeus.get("127.0.0.1:8101/?blah=1")
|
257
|
-
end
|
258
|
-
|
259
|
-
traces = get_all_traces
|
260
|
-
traces[5]['RemoteURL'].casecmp('http://127.0.0.1:8101/').must_equal 0
|
261
|
-
end
|
262
|
-
|
263
|
-
it 'should obey :collect_backtraces setting when true' do
|
264
|
-
AppOpticsAPM::Config[:typhoeus][:collect_backtraces] = true
|
265
|
-
|
266
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
267
|
-
Typhoeus.get("127.0.0.1:8101/?blah=1")
|
268
|
-
end
|
269
|
-
|
270
|
-
traces = get_all_traces
|
271
|
-
layer_has_key(traces, 'typhoeus', 'Backtrace')
|
272
|
-
end
|
273
|
-
|
274
|
-
it 'should obey :collect_backtraces setting when false' do
|
275
|
-
AppOpticsAPM::Config[:typhoeus][:collect_backtraces] = false
|
276
|
-
|
277
|
-
AppOpticsAPM::API.start_trace('typhoeus_test') do
|
278
|
-
Typhoeus.get("127.0.0.1:8101/")
|
279
|
-
end
|
280
|
-
|
281
|
-
traces = get_all_traces
|
282
|
-
layer_doesnt_have_key(traces, 'typhoeus', 'Backtrace')
|
283
|
-
end
|
284
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
class DJDBWorkerJob
|
5
|
-
@queue = :normal
|
6
|
-
|
7
|
-
def self.perform(*args)
|
8
|
-
return unless defined?(::Sequel) && !defined?(JRUBY_VERSION)
|
9
|
-
|
10
|
-
if ENV.key?('TRAVIS_MYSQL_PASS')
|
11
|
-
@db = Sequel.connect("mysql2://root:#{ENV['TRAVIS_MYSQL_PASS']}@127.0.0.1:3306/travis_ci_test")
|
12
|
-
else
|
13
|
-
@db = Sequel.connect('mysql2://root@127.0.0.1:3306/travis_ci_test')
|
14
|
-
end
|
15
|
-
|
16
|
-
unless @db.table_exists?(:items)
|
17
|
-
@db.create_table :items do
|
18
|
-
primary_key :id
|
19
|
-
String :name
|
20
|
-
Float :price
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
@db.run('select 1')
|
25
|
-
|
26
|
-
items = @db[:items]
|
27
|
-
items.count
|
28
|
-
end
|
29
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
class DJRemoteCallWorkerJob
|
5
|
-
@queue = :critical
|
6
|
-
|
7
|
-
def self.perform(*args)
|
8
|
-
# Make some random Dalli (memcache) calls and top it
|
9
|
-
# off with an excon call to the background rack webserver.
|
10
|
-
@dc = Dalli::Client.new
|
11
|
-
@dc.get(rand(10).to_s)
|
12
|
-
uri = URI('http://gameface.in/gamers')
|
13
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
14
|
-
request = Net::HTTP::Get.new(uri.request_uri)
|
15
|
-
http.request(request)
|
16
|
-
@dc.get(rand(10).to_s)
|
17
|
-
@dc.get(rand(10).to_s)
|
18
|
-
@dc.get_multi([:one, :two, :three, :four, :five, :six])
|
19
|
-
end
|
20
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
class ResqueDBWorkerJob
|
5
|
-
@queue = :normal
|
6
|
-
|
7
|
-
def self.perform(*args)
|
8
|
-
return unless defined?(::Sequel) && !defined?(JRUBY_VERSION)
|
9
|
-
|
10
|
-
if ENV.key?('TRAVIS_MYSQL_PASS')
|
11
|
-
@db = Sequel.connect("mysql2://root:#{ENV['TRAVIS_MYSQL_PASS']}@127.0.0.1:3306/travis_ci_test")
|
12
|
-
else
|
13
|
-
@db = Sequel.connect('mysql2://root@127.0.0.1:3306/travis_ci_test')
|
14
|
-
end
|
15
|
-
|
16
|
-
unless @db.table_exists?(:items)
|
17
|
-
@db.create_table :items do
|
18
|
-
primary_key :id
|
19
|
-
String :name
|
20
|
-
Float :price
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
@db.run('select 1')
|
25
|
-
|
26
|
-
items = @db[:items]
|
27
|
-
items.count
|
28
|
-
end
|
29
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
class ResqueRemoteCallWorkerJob
|
5
|
-
@queue = :critical
|
6
|
-
|
7
|
-
def self.perform(*args)
|
8
|
-
# Make some random Dalli (memcache) calls and top it
|
9
|
-
# off with an excon call to the background rack webserver.
|
10
|
-
@dc = Dalli::Client.new
|
11
|
-
@dc.get(rand(10).to_s)
|
12
|
-
uri = URI('http://gameface.in/gamers')
|
13
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
14
|
-
request = Net::HTTP::Get.new(uri.request_uri)
|
15
|
-
http.request(request)
|
16
|
-
@dc.get(rand(10).to_s)
|
17
|
-
@dc.get(rand(10).to_s)
|
18
|
-
@dc.get_multi([:one, :two, :three, :four, :five, :six])
|
19
|
-
end
|
20
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016 SolarWinds, LLC.
|
2
|
-
# All rights reserved.
|
3
|
-
|
4
|
-
class DBWorkerJob
|
5
|
-
include Sidekiq::Worker
|
6
|
-
|
7
|
-
def perform(*args)
|
8
|
-
return unless defined?(::Sequel) && !defined?(JRUBY_VERSION)
|
9
|
-
|
10
|
-
if ENV.key?('TRAVIS_MYSQL_PASS')
|
11
|
-
@db = Sequel.connect("mysql2://root:#{ENV['TRAVIS_MYSQL_PASS']}@127.0.0.1:3306/travis_ci_test")
|
12
|
-
else
|
13
|
-
@db = Sequel.connect('mysql2://root@127.0.0.1:3306/travis_ci_test')
|
14
|
-
end
|
15
|
-
|
16
|
-
unless @db.table_exists?(:items)
|
17
|
-
@db.create_table :items do
|
18
|
-
primary_key :id
|
19
|
-
String :name
|
20
|
-
Float :price
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
@db.run('select 1')
|
25
|
-
|
26
|
-
items = @db[:items]
|
27
|
-
items.count
|
28
|
-
end
|
29
|
-
end
|