roqua-support 0.3.0 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +18 -49
- data/Appraisals +9 -8
- data/CHANGELOG.md +21 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +126 -121
- data/gemfiles/rails51.gemfile +6 -5
- data/gemfiles/rails52.gemfile +7 -5
- data/gemfiles/{rails42.gemfile → rails60.gemfile} +8 -6
- data/lib/roqua-support/version.rb +1 -1
- data/lib/roqua/probes/base_probe.rb +16 -4
- data/lib/roqua/probes/delayed_job_probe.rb +2 -2
- data/lib/roqua/probes/monitoring_probe.rb +2 -2
- data/lib/roqua/probes/scheduling_probe.rb +2 -2
- data/lib/roqua/scheduling/scheduler.rb +3 -0
- data/lib/roqua/support/errors.rb +1 -0
- data/roqua-support.gemspec +4 -4
- data/spec/roqua/probes/delayed_job_probe_spec.rb +7 -2
- data/spec/roqua/probes/monitoring_probe_spec.rb +8 -3
- data/spec/roqua/scheduling/scheduler_spec.rb +9 -1
- data/spec/roqua/support/errors_spec.rb +1 -0
- metadata +23 -33
- data/gemfiles/rails50.gemfile +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32f750bb036e58d68411a3a96f126a551cb4766811fb7fa0daea753a6d7d3613
|
4
|
+
data.tar.gz: 4895312bd0ab8055da376681c894d32a62dbb9885d923d6a452cf3688ee076fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0187621d35a2c8b8e379eb330f6b91a5a34856b6fe411fa2837850af5fb885ce97cb8f69cd2720ce5908b2e081b72f2445fee91a8216d3836be5f3571864ae19'
|
7
|
+
data.tar.gz: 6148e080d64301dd0cb410ed4c5d0337018411cea03041b865e6c239936ed12f6a7032b451704dbecac984a1c66e5340d87fb69632b184f0fbdaa807f6292765
|
data/.gitlab-ci.yml
CHANGED
@@ -2,25 +2,12 @@ variables:
|
|
2
2
|
RAILS_ENV: "test"
|
3
3
|
|
4
4
|
before_script:
|
5
|
+
- if [ -x "$(command -v apk)" ]; then apk add sqlite-dev; fi
|
5
6
|
- export BUNDLE_PATH=$CI_PROJECT_DIR/.gems
|
6
7
|
- bundle --jobs 2 --retry 3
|
7
8
|
- bundle exec appraisal
|
8
9
|
- bundle --jobs 2 --retry 3
|
9
10
|
|
10
|
-
.ruby_23: &ruby_23
|
11
|
-
image: registry.roqua.nl/roqua/roqua-build-images:ruby-2.3-rails-base-test
|
12
|
-
cache:
|
13
|
-
key: ruby_23
|
14
|
-
paths:
|
15
|
-
- .gems
|
16
|
-
|
17
|
-
.ruby_24: &ruby_24
|
18
|
-
image: registry.roqua.nl/roqua/roqua-build-images:ruby-2.4-rails-base-test
|
19
|
-
cache:
|
20
|
-
key: ruby_24
|
21
|
-
paths:
|
22
|
-
- .gems
|
23
|
-
|
24
11
|
.ruby_25: &ruby_25
|
25
12
|
image: registry.roqua.nl/roqua/docker-base-images:ruby-2.5
|
26
13
|
cache:
|
@@ -28,52 +15,34 @@ before_script:
|
|
28
15
|
paths:
|
29
16
|
- .gems
|
30
17
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<<: *ruby_23
|
38
|
-
script:
|
39
|
-
- bundle exec appraisal rails50 bundle exec rspec
|
40
|
-
|
41
|
-
rails_50_ruby_24:
|
42
|
-
<<: *ruby_24
|
43
|
-
script:
|
44
|
-
- bundle exec appraisal rails50 bundle exec rspec
|
45
|
-
|
46
|
-
rails_50_ruby_25:
|
47
|
-
<<: *ruby_25
|
48
|
-
script:
|
49
|
-
- bundle exec appraisal rails50 bundle exec rspec
|
50
|
-
|
51
|
-
rails_51_ruby_23:
|
52
|
-
<<: *ruby_23
|
53
|
-
script:
|
54
|
-
- bundle exec appraisal rails51 bundle exec rspec
|
55
|
-
|
56
|
-
rails_51_ruby_24:
|
57
|
-
<<: *ruby_24
|
58
|
-
script:
|
59
|
-
- bundle exec appraisal rails51 bundle exec rspec
|
18
|
+
.ruby_26: &ruby_26
|
19
|
+
image: registry.roqua.nl/roqua/docker-base-images:ruby-2.6-builder
|
20
|
+
cache:
|
21
|
+
key: ruby_26
|
22
|
+
paths:
|
23
|
+
- .gems
|
60
24
|
|
61
25
|
rails_51_ruby_25:
|
62
26
|
<<: *ruby_25
|
63
27
|
script:
|
64
28
|
- bundle exec appraisal rails51 bundle exec rspec
|
65
29
|
|
66
|
-
|
67
|
-
<<: *
|
30
|
+
rails_52_ruby_25:
|
31
|
+
<<: *ruby_25
|
68
32
|
script:
|
69
33
|
- bundle exec appraisal rails52 bundle exec rspec
|
70
34
|
|
71
|
-
|
72
|
-
<<: *
|
35
|
+
rails_52_ruby_26:
|
36
|
+
<<: *ruby_26
|
73
37
|
script:
|
74
38
|
- bundle exec appraisal rails52 bundle exec rspec
|
75
39
|
|
76
|
-
|
40
|
+
rails_60_ruby_25:
|
77
41
|
<<: *ruby_25
|
78
42
|
script:
|
79
|
-
- bundle exec appraisal
|
43
|
+
- bundle exec appraisal rails60 bundle exec rspec
|
44
|
+
|
45
|
+
rails_60_ruby_26:
|
46
|
+
<<: *ruby_26
|
47
|
+
script:
|
48
|
+
- bundle exec appraisal rails60 bundle exec rspec
|
data/Appraisals
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
appraise "rails42" do
|
2
|
-
gem "activesupport", "~> 4.2.10"
|
3
|
-
end
|
4
|
-
|
5
|
-
appraise "rails50" do
|
6
|
-
gem "activesupport", "~> 5.0.0"
|
7
|
-
end
|
8
|
-
|
9
1
|
appraise "rails51" do
|
10
2
|
gem "activesupport", "~> 5.1.0"
|
3
|
+
gem 'sqlite3', '~> 1.3.6'
|
11
4
|
end
|
12
5
|
|
13
6
|
appraise "rails52" do
|
14
7
|
gem "activesupport", "~> 5.2.0"
|
8
|
+
gem 'sqlite3', '~> 1.4'
|
9
|
+
gem 'appsignal', '~> 2.9.8' # test each minor versions we support
|
10
|
+
end
|
11
|
+
|
12
|
+
appraise "rails60" do
|
13
|
+
gem "activesupport", "~> 6.0.0"
|
14
|
+
gem 'sqlite3', '~> 1.4'
|
15
|
+
gem 'appsignal', '~> 2.10.6'
|
15
16
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
## 0.3.5
|
2
|
+
|
3
|
+
* Update AppSignal gauge for every minute the probe runs
|
4
|
+
|
5
|
+
## 0.3.4
|
6
|
+
|
7
|
+
* gemspec and tests: Removed rails 4.2 and 5.0, remove ruby 2.3 and 2.4, added ruby 2.6, allow appsignal 2.10
|
8
|
+
|
9
|
+
## 0.3.3
|
10
|
+
|
11
|
+
* Added support for hl7 namespace when reporting errors
|
12
|
+
|
13
|
+
## 0.3.2
|
14
|
+
|
15
|
+
* Use tags for better appsignal metrics
|
16
|
+
* Require Appsignal 2.9 to avoid probe registration problems
|
17
|
+
|
18
|
+
## 0.3.1
|
19
|
+
|
20
|
+
* Added Appsignal counters for probe calls and scheduling probe call tasks in particular.
|
21
|
+
|
1
22
|
## 0.3.0
|
2
23
|
|
3
24
|
* Support for Ruby 2.5
|
data/Gemfile
CHANGED
@@ -9,12 +9,12 @@ gem 'roqua_styleguide', git: 'https://gitlab.roqua.nl/roqua/styleguide.git'
|
|
9
9
|
group :test do
|
10
10
|
gem 'actionpack', '>= 4.0'
|
11
11
|
gem 'active_interaction', '~> 3.0'
|
12
|
-
gem 'appsignal', '~> 2.9.6'
|
13
12
|
gem 'climate_control' # For ENV modification in specs
|
14
|
-
gem 'combustion', '~>
|
13
|
+
gem 'combustion', '~> 1.1.1'
|
15
14
|
gem 'fakefs', require: 'fakefs/safe'
|
16
15
|
gem 'guard-rspec', '~> 4.2.6'
|
17
16
|
gem 'responders'
|
18
17
|
gem 'rspec-instrumentation-matcher'
|
19
18
|
gem 'rspec-rails'
|
20
|
-
|
19
|
+
gem 'pry'
|
20
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,78 +1,80 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://gitlab.roqua.nl/roqua/styleguide.git
|
3
|
-
revision:
|
3
|
+
revision: 6d98107ef10d2dc5a4a785a4b0977f100475e007
|
4
4
|
specs:
|
5
|
-
roqua_styleguide (0.0.
|
6
|
-
rubocop (~> 0.
|
5
|
+
roqua_styleguide (0.0.8)
|
6
|
+
rubocop (~> 0.80.0)
|
7
|
+
rubocop-rails
|
7
8
|
|
8
9
|
PATH
|
9
10
|
remote: .
|
10
11
|
specs:
|
11
|
-
roqua-support (0.3.
|
12
|
+
roqua-support (0.3.5)
|
12
13
|
active_interaction (~> 3.0)
|
13
|
-
activesupport (>=
|
14
|
+
activesupport (>= 5.1, < 6.1)
|
15
|
+
appsignal (>= 2.9, < 2.11)
|
14
16
|
naught (~> 1.0)
|
15
17
|
with_advisory_lock (~> 3.2)
|
16
18
|
|
17
19
|
GEM
|
18
20
|
remote: https://rubygems.org/
|
19
21
|
specs:
|
20
|
-
actionpack (
|
21
|
-
actionview (=
|
22
|
-
activesupport (=
|
23
|
-
rack (~> 2.0)
|
24
|
-
rack-test (
|
22
|
+
actionpack (6.0.2.2)
|
23
|
+
actionview (= 6.0.2.2)
|
24
|
+
activesupport (= 6.0.2.2)
|
25
|
+
rack (~> 2.0, >= 2.0.8)
|
26
|
+
rack-test (>= 0.6.3)
|
25
27
|
rails-dom-testing (~> 2.0)
|
26
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
27
|
-
actionview (
|
28
|
-
activesupport (=
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
29
|
+
actionview (6.0.2.2)
|
30
|
+
activesupport (= 6.0.2.2)
|
29
31
|
builder (~> 3.1)
|
30
|
-
|
32
|
+
erubi (~> 1.4)
|
31
33
|
rails-dom-testing (~> 2.0)
|
32
|
-
rails-html-sanitizer (~> 1.
|
33
|
-
active_interaction (3.
|
34
|
-
activemodel (>= 4, <
|
35
|
-
activemodel (
|
36
|
-
activesupport (=
|
37
|
-
activerecord (
|
38
|
-
activemodel (=
|
39
|
-
activesupport (=
|
40
|
-
|
41
|
-
activesupport (5.0.1)
|
34
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
35
|
+
active_interaction (3.8.2)
|
36
|
+
activemodel (>= 4, < 7)
|
37
|
+
activemodel (6.0.2.2)
|
38
|
+
activesupport (= 6.0.2.2)
|
39
|
+
activerecord (6.0.2.2)
|
40
|
+
activemodel (= 6.0.2.2)
|
41
|
+
activesupport (= 6.0.2.2)
|
42
|
+
activesupport (6.0.2.2)
|
42
43
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
43
|
-
i18n (
|
44
|
+
i18n (>= 0.7, < 2)
|
44
45
|
minitest (~> 5.1)
|
45
46
|
tzinfo (~> 1.1)
|
46
|
-
|
47
|
+
zeitwerk (~> 2.2)
|
48
|
+
appraisal (2.2.0)
|
47
49
|
bundler
|
48
50
|
rake
|
49
51
|
thor (>= 0.14.0)
|
50
|
-
appsignal (2.
|
52
|
+
appsignal (2.10.12)
|
51
53
|
rack
|
52
|
-
|
53
|
-
|
54
|
-
builder (3.2.3)
|
54
|
+
ast (2.4.0)
|
55
|
+
builder (3.2.4)
|
55
56
|
climate_control (0.2.0)
|
56
|
-
coderay (1.1.
|
57
|
-
combustion (
|
57
|
+
coderay (1.1.2)
|
58
|
+
combustion (1.1.2)
|
58
59
|
activesupport (>= 3.0.0)
|
59
60
|
railties (>= 3.0.0)
|
60
61
|
thor (>= 0.14.6)
|
61
|
-
concurrent-ruby (1.
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
concurrent-ruby (1.1.6)
|
63
|
+
crass (1.0.6)
|
64
|
+
delayed_job (4.1.8)
|
65
|
+
activesupport (>= 3.0, < 6.1)
|
66
|
+
delayed_job_active_record (4.1.4)
|
67
|
+
activerecord (>= 3.0, < 6.1)
|
66
68
|
delayed_job (>= 3.0, < 5)
|
67
69
|
diff-lcs (1.3)
|
68
|
-
|
69
|
-
fakefs (
|
70
|
-
ffi (1.
|
70
|
+
erubi (1.9.0)
|
71
|
+
fakefs (1.2.2)
|
72
|
+
ffi (1.12.2)
|
71
73
|
formatador (0.2.5)
|
72
|
-
guard (2.
|
74
|
+
guard (2.16.2)
|
73
75
|
formatador (>= 0.2.4)
|
74
76
|
listen (>= 2.7, < 4.0)
|
75
|
-
lumberjack (
|
77
|
+
lumberjack (>= 1.0.12, < 2.0)
|
76
78
|
nenv (~> 0.1)
|
77
79
|
notiffany (~> 0.0)
|
78
80
|
pry (>= 0.9.12)
|
@@ -81,98 +83,102 @@ GEM
|
|
81
83
|
guard-rspec (4.2.10)
|
82
84
|
guard (~> 2.1)
|
83
85
|
rspec (>= 2.14, < 4.0)
|
84
|
-
i18n (
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
86
|
+
i18n (1.8.2)
|
87
|
+
concurrent-ruby (~> 1.0)
|
88
|
+
jaro_winkler (1.5.4)
|
89
|
+
listen (3.2.1)
|
90
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
91
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
92
|
+
loofah (2.5.0)
|
93
|
+
crass (~> 1.0.2)
|
90
94
|
nokogiri (>= 1.5.9)
|
91
|
-
lumberjack (1.
|
92
|
-
method_source (0.
|
93
|
-
mini_portile2 (2.
|
94
|
-
minitest (5.
|
95
|
+
lumberjack (1.2.4)
|
96
|
+
method_source (1.0.0)
|
97
|
+
mini_portile2 (2.4.0)
|
98
|
+
minitest (5.14.0)
|
95
99
|
naught (1.1.0)
|
96
100
|
nenv (0.3.0)
|
97
|
-
nokogiri (1.
|
98
|
-
mini_portile2 (~> 2.
|
99
|
-
notiffany (0.1.
|
101
|
+
nokogiri (1.10.9)
|
102
|
+
mini_portile2 (~> 2.4.0)
|
103
|
+
notiffany (0.1.3)
|
100
104
|
nenv (~> 0.1)
|
101
105
|
shellany (~> 0.0)
|
102
|
-
parallel (1.
|
103
|
-
parser (2.
|
104
|
-
ast (~> 2.
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
actionpack (= 5.0.1)
|
120
|
-
activesupport (= 5.0.1)
|
106
|
+
parallel (1.19.1)
|
107
|
+
parser (2.7.1.2)
|
108
|
+
ast (~> 2.4.0)
|
109
|
+
pry (0.13.1)
|
110
|
+
coderay (~> 1.1)
|
111
|
+
method_source (~> 1.0)
|
112
|
+
rack (2.2.2)
|
113
|
+
rack-test (1.1.0)
|
114
|
+
rack (>= 1.0, < 3)
|
115
|
+
rails-dom-testing (2.0.3)
|
116
|
+
activesupport (>= 4.2.0)
|
117
|
+
nokogiri (>= 1.6)
|
118
|
+
rails-html-sanitizer (1.3.0)
|
119
|
+
loofah (~> 2.3)
|
120
|
+
railties (6.0.2.2)
|
121
|
+
actionpack (= 6.0.2.2)
|
122
|
+
activesupport (= 6.0.2.2)
|
121
123
|
method_source
|
122
124
|
rake (>= 0.8.7)
|
123
|
-
thor (>= 0.
|
124
|
-
rainbow (
|
125
|
-
|
126
|
-
|
127
|
-
rb-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
railties (>=
|
132
|
-
|
133
|
-
|
134
|
-
rspec-
|
135
|
-
rspec-
|
136
|
-
|
137
|
-
|
138
|
-
|
125
|
+
thor (>= 0.20.3, < 2.0)
|
126
|
+
rainbow (3.0.0)
|
127
|
+
rake (13.0.1)
|
128
|
+
rb-fsevent (0.10.4)
|
129
|
+
rb-inotify (0.10.1)
|
130
|
+
ffi (~> 1.0)
|
131
|
+
responders (3.0.0)
|
132
|
+
actionpack (>= 5.0)
|
133
|
+
railties (>= 5.0)
|
134
|
+
rexml (3.2.4)
|
135
|
+
rspec (3.9.0)
|
136
|
+
rspec-core (~> 3.9.0)
|
137
|
+
rspec-expectations (~> 3.9.0)
|
138
|
+
rspec-mocks (~> 3.9.0)
|
139
|
+
rspec-core (3.9.2)
|
140
|
+
rspec-support (~> 3.9.3)
|
141
|
+
rspec-expectations (3.9.1)
|
139
142
|
diff-lcs (>= 1.2.0, < 2.0)
|
140
|
-
rspec-support (~> 3.
|
141
|
-
rspec-instrumentation-matcher (0.0.
|
143
|
+
rspec-support (~> 3.9.0)
|
144
|
+
rspec-instrumentation-matcher (0.0.9)
|
142
145
|
activesupport
|
143
146
|
rspec-expectations
|
144
|
-
rspec-mocks (3.
|
147
|
+
rspec-mocks (3.9.1)
|
145
148
|
diff-lcs (>= 1.2.0, < 2.0)
|
146
|
-
rspec-support (~> 3.
|
147
|
-
rspec-rails (
|
148
|
-
actionpack (>=
|
149
|
-
activesupport (>=
|
150
|
-
railties (>=
|
151
|
-
rspec-core (~> 3.
|
152
|
-
rspec-expectations (~> 3.
|
153
|
-
rspec-mocks (~> 3.
|
154
|
-
rspec-support (~> 3.
|
155
|
-
rspec-support (3.
|
156
|
-
rubocop (0.
|
149
|
+
rspec-support (~> 3.9.0)
|
150
|
+
rspec-rails (4.0.0)
|
151
|
+
actionpack (>= 4.2)
|
152
|
+
activesupport (>= 4.2)
|
153
|
+
railties (>= 4.2)
|
154
|
+
rspec-core (~> 3.9)
|
155
|
+
rspec-expectations (~> 3.9)
|
156
|
+
rspec-mocks (~> 3.9)
|
157
|
+
rspec-support (~> 3.9)
|
158
|
+
rspec-support (3.9.3)
|
159
|
+
rubocop (0.80.1)
|
160
|
+
jaro_winkler (~> 1.5.1)
|
157
161
|
parallel (~> 1.10)
|
158
|
-
parser (>= 2.
|
159
|
-
|
160
|
-
|
162
|
+
parser (>= 2.7.0.1)
|
163
|
+
rainbow (>= 2.2.2, < 4.0)
|
164
|
+
rexml
|
161
165
|
ruby-progressbar (~> 1.7)
|
162
|
-
unicode-display_width (
|
163
|
-
|
164
|
-
|
166
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
167
|
+
rubocop-rails (2.5.2)
|
168
|
+
activesupport
|
169
|
+
rack (>= 1.1)
|
170
|
+
rubocop (>= 0.72.0)
|
171
|
+
ruby-progressbar (1.10.1)
|
165
172
|
shellany (0.0.1)
|
166
|
-
|
167
|
-
|
168
|
-
thor (0.19.4)
|
169
|
-
thread_safe (0.3.5)
|
173
|
+
thor (1.0.1)
|
174
|
+
thread_safe (0.3.6)
|
170
175
|
timecop (0.9.1)
|
171
|
-
tzinfo (1.2.
|
176
|
+
tzinfo (1.2.7)
|
172
177
|
thread_safe (~> 0.1)
|
173
|
-
unicode-display_width (1.
|
178
|
+
unicode-display_width (1.6.1)
|
174
179
|
with_advisory_lock (3.2.0)
|
175
180
|
activerecord (>= 3.2)
|
181
|
+
zeitwerk (2.3.0)
|
176
182
|
|
177
183
|
PLATFORMS
|
178
184
|
ruby
|
@@ -181,13 +187,13 @@ DEPENDENCIES
|
|
181
187
|
actionpack (>= 4.0)
|
182
188
|
active_interaction (~> 3.0)
|
183
189
|
appraisal
|
184
|
-
|
185
|
-
bundler (~> 1.0)
|
190
|
+
bundler (~> 2.0)
|
186
191
|
climate_control
|
187
|
-
combustion (~>
|
192
|
+
combustion (~> 1.1.1)
|
188
193
|
delayed_job_active_record
|
189
194
|
fakefs
|
190
195
|
guard-rspec (~> 4.2.6)
|
196
|
+
pry
|
191
197
|
rake
|
192
198
|
responders
|
193
199
|
roqua-support!
|
@@ -195,8 +201,7 @@ DEPENDENCIES
|
|
195
201
|
rspec (>= 2.12.0, < 4.0)
|
196
202
|
rspec-instrumentation-matcher
|
197
203
|
rspec-rails
|
198
|
-
sqlite3 (~> 1.3.6)
|
199
204
|
timecop
|
200
205
|
|
201
206
|
BUNDLED WITH
|
202
|
-
1.
|
207
|
+
2.1.4
|
data/gemfiles/rails51.gemfile
CHANGED
@@ -3,20 +3,21 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gem "appraisal"
|
6
|
-
gem "roqua_styleguide", :
|
6
|
+
gem "roqua_styleguide", git: "https://gitlab.roqua.nl/roqua/styleguide.git"
|
7
7
|
gem "activesupport", "~> 5.1.0"
|
8
|
+
gem "sqlite3", "~> 1.3.6"
|
8
9
|
|
9
10
|
group :test do
|
10
11
|
gem "actionpack", ">= 4.0"
|
11
12
|
gem "active_interaction", "~> 3.0"
|
12
|
-
gem "appsignal"
|
13
13
|
gem "climate_control"
|
14
|
-
gem "combustion", "~>
|
15
|
-
gem "fakefs", :
|
14
|
+
gem "combustion", "~> 1.1.1"
|
15
|
+
gem "fakefs", require: "fakefs/safe"
|
16
16
|
gem "guard-rspec", "~> 4.2.6"
|
17
17
|
gem "responders"
|
18
18
|
gem "rspec-instrumentation-matcher"
|
19
19
|
gem "rspec-rails"
|
20
|
+
gem "pry"
|
20
21
|
end
|
21
22
|
|
22
|
-
gemspec :
|
23
|
+
gemspec path: "../"
|
data/gemfiles/rails52.gemfile
CHANGED
@@ -3,20 +3,22 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gem "appraisal"
|
6
|
-
gem "roqua_styleguide", :
|
6
|
+
gem "roqua_styleguide", git: "https://gitlab.roqua.nl/roqua/styleguide.git"
|
7
7
|
gem "activesupport", "~> 5.2.0"
|
8
|
+
gem "sqlite3", "~> 1.4"
|
9
|
+
gem "appsignal", "~> 2.9.8"
|
8
10
|
|
9
11
|
group :test do
|
10
12
|
gem "actionpack", ">= 4.0"
|
11
13
|
gem "active_interaction", "~> 3.0"
|
12
|
-
gem "appsignal"
|
13
14
|
gem "climate_control"
|
14
|
-
gem "combustion", "~>
|
15
|
-
gem "fakefs", :
|
15
|
+
gem "combustion", "~> 1.1.1"
|
16
|
+
gem "fakefs", require: "fakefs/safe"
|
16
17
|
gem "guard-rspec", "~> 4.2.6"
|
17
18
|
gem "responders"
|
18
19
|
gem "rspec-instrumentation-matcher"
|
19
20
|
gem "rspec-rails"
|
21
|
+
gem "pry"
|
20
22
|
end
|
21
23
|
|
22
|
-
gemspec :
|
24
|
+
gemspec path: "../"
|
@@ -3,20 +3,22 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gem "appraisal"
|
6
|
-
gem "roqua_styleguide", :
|
7
|
-
gem "activesupport", "~>
|
6
|
+
gem "roqua_styleguide", git: "https://gitlab.roqua.nl/roqua/styleguide.git"
|
7
|
+
gem "activesupport", "~> 6.0.0"
|
8
|
+
gem "sqlite3", "~> 1.4"
|
9
|
+
gem "appsignal", "~> 2.10.6"
|
8
10
|
|
9
11
|
group :test do
|
10
12
|
gem "actionpack", ">= 4.0"
|
11
13
|
gem "active_interaction", "~> 3.0"
|
12
|
-
gem "appsignal"
|
13
14
|
gem "climate_control"
|
14
|
-
gem "combustion", "~>
|
15
|
-
gem "fakefs", :
|
15
|
+
gem "combustion", "~> 1.1.1"
|
16
|
+
gem "fakefs", require: "fakefs/safe"
|
16
17
|
gem "guard-rspec", "~> 4.2.6"
|
17
18
|
gem "responders"
|
18
19
|
gem "rspec-instrumentation-matcher"
|
19
20
|
gem "rspec-rails"
|
21
|
+
gem "pry"
|
20
22
|
end
|
21
23
|
|
22
|
-
gemspec :
|
24
|
+
gemspec path: "../"
|
@@ -1,12 +1,24 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
|
1
3
|
module Roqua
|
2
4
|
module Probes
|
3
5
|
module BaseProbe
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
class_methods do
|
9
|
+
def enable
|
10
|
+
new.tap do |probe|
|
11
|
+
probe_sym = probe.class.to_s.to_sym
|
12
|
+
Appsignal::Minutely.probes.register(probe_sym, probe) unless Appsignal::Minutely.probes[probe_sym]
|
13
|
+
end
|
8
14
|
end
|
9
15
|
end
|
16
|
+
|
17
|
+
# do not override me, implement probes by implementing the #run method
|
18
|
+
def call
|
19
|
+
run
|
20
|
+
Appsignal.increment_counter("probe.call.completed", 1, probe_name: self.class.name.demodulize.underscore)
|
21
|
+
end
|
10
22
|
end
|
11
23
|
end
|
12
24
|
end
|
@@ -3,13 +3,13 @@ require_relative 'base_probe'
|
|
3
3
|
module Roqua
|
4
4
|
module Probes
|
5
5
|
class DelayedJobProbe
|
6
|
-
|
6
|
+
include BaseProbe
|
7
7
|
|
8
8
|
def backlog_count
|
9
9
|
Delayed::Job.where(locked_at: nil).where('run_at < ?', Time.zone.now).count
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def run
|
13
13
|
Appsignal.set_gauge('delayed_job_backlog_count', backlog_count)
|
14
14
|
end
|
15
15
|
end
|
@@ -3,7 +3,7 @@ require_relative 'base_probe'
|
|
3
3
|
module Roqua
|
4
4
|
module Probes
|
5
5
|
class MonitoringProbe
|
6
|
-
|
6
|
+
include BaseProbe
|
7
7
|
|
8
8
|
def incomplete_jobs
|
9
9
|
Roqua::Scheduling::CronJob.where('completed_at IS NULL OR completed_at < next_run_at')
|
@@ -19,7 +19,7 @@ module Roqua
|
|
19
19
|
(longest_delay_in_seconds / 1.minute).to_i
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
22
|
+
def run
|
23
23
|
Appsignal.set_gauge('scheduler_delay_in_minutes', longest_delay_in_minutes)
|
24
24
|
end
|
25
25
|
end
|
@@ -3,9 +3,9 @@ require_relative 'base_probe'
|
|
3
3
|
module Roqua
|
4
4
|
module Probes
|
5
5
|
class SchedulingProbe
|
6
|
-
|
6
|
+
include BaseProbe
|
7
7
|
|
8
|
-
def
|
8
|
+
def run
|
9
9
|
ActiveRecord::Base.establish_connection
|
10
10
|
require_relative Rails.root.join('config', 'schedule.rb')
|
11
11
|
Roqua::Scheduling::Scheduler.new.ping
|
@@ -11,6 +11,8 @@ class Roqua::Scheduling::Scheduler
|
|
11
11
|
raise ex if Rails.env.test?
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
Appsignal.increment_counter("scheduler.completed", 1)
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
@@ -42,6 +44,7 @@ class Roqua::Scheduling::Scheduler
|
|
42
44
|
task = schedule.tasks[cron_job.name]
|
43
45
|
task.run
|
44
46
|
|
47
|
+
Appsignal.increment_counter("scheduler.run_task.completed", 1, task_name: task.name)
|
45
48
|
cron_job.update completed_at: Time.now, next_run_at: task.next_run_at
|
46
49
|
end
|
47
50
|
end
|
data/lib/roqua/support/errors.rb
CHANGED
data/roqua-support.gemspec
CHANGED
@@ -18,16 +18,16 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
+
gem.required_ruby_version = '>= 2.5'
|
21
22
|
gem.add_dependency 'active_interaction', '~> 3.0'
|
22
|
-
gem.add_dependency 'activesupport', '>=
|
23
|
+
gem.add_dependency 'activesupport', '>= 5.1', '< 6.1'
|
23
24
|
gem.add_dependency 'naught', '~> 1.0'
|
24
25
|
gem.add_dependency 'with_advisory_lock', '~> 3.2'
|
26
|
+
gem.add_dependency 'appsignal', '>= 2.9', '< 2.11'
|
25
27
|
|
26
|
-
gem.add_development_dependency '
|
27
|
-
gem.add_development_dependency 'bundler', '~> 1.0'
|
28
|
+
gem.add_development_dependency 'bundler', '~> 2.0'
|
28
29
|
gem.add_development_dependency 'delayed_job_active_record'
|
29
30
|
gem.add_development_dependency 'rake'
|
30
31
|
gem.add_development_dependency 'rspec', '>= 2.12.0', '< 4.0'
|
31
|
-
gem.add_development_dependency 'sqlite3', '~> 1.3.6'
|
32
32
|
gem.add_development_dependency 'timecop'
|
33
33
|
end
|
@@ -7,7 +7,7 @@ require 'roqua/probes/delayed_job_probe'
|
|
7
7
|
describe Roqua::Probes::DelayedJobProbe do
|
8
8
|
before { Timecop.freeze }
|
9
9
|
after { Timecop.return }
|
10
|
-
subject(:probe) {
|
10
|
+
subject(:probe) { described_class.new }
|
11
11
|
|
12
12
|
describe 'backlog_count' do
|
13
13
|
context 'if a single job unlocked job exists that has a run_at in the past' do
|
@@ -24,12 +24,17 @@ describe Roqua::Probes::DelayedJobProbe do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
describe 'call' do
|
27
|
+
describe '#call' do
|
28
28
|
it 'sends the correct metric to Appsignal' do
|
29
29
|
expect(probe).to receive(:backlog_count).and_return(12)
|
30
30
|
expect(Appsignal).to receive(:set_gauge).with('delayed_job_backlog_count', 12)
|
31
31
|
probe.call
|
32
32
|
end
|
33
|
+
|
34
|
+
it 'increments the probe call counter' do
|
35
|
+
expect(Appsignal).to receive(:increment_counter).with('probe.call.completed', 1, probe_name: "delayed_job_probe")
|
36
|
+
probe.call
|
37
|
+
end
|
33
38
|
end
|
34
39
|
|
35
40
|
context '.enable' do
|
@@ -4,21 +4,26 @@ require 'timecop'
|
|
4
4
|
|
5
5
|
require 'roqua/probes/delayed_job_probe'
|
6
6
|
|
7
|
-
describe Roqua::Probes::
|
7
|
+
describe Roqua::Probes::MonitoringProbe do
|
8
8
|
before { Timecop.freeze }
|
9
9
|
after { Timecop.return }
|
10
|
-
subject(:probe) {
|
10
|
+
subject(:probe) { described_class.new }
|
11
11
|
|
12
12
|
before do
|
13
13
|
Roqua::Scheduling::CronJob.delete_all
|
14
14
|
end
|
15
15
|
|
16
|
-
describe 'call' do
|
16
|
+
describe '#call' do
|
17
17
|
it 'sends data to AppSignal' do
|
18
18
|
expect(Appsignal).to receive(:set_gauge).with('scheduler_delay_in_minutes', 10)
|
19
19
|
expect(probe).to receive(:longest_delay_in_minutes).and_return(10)
|
20
20
|
probe.call
|
21
21
|
end
|
22
|
+
|
23
|
+
it 'increments the probe call counter' do
|
24
|
+
expect(Appsignal).to receive(:increment_counter).with('probe.call.completed', 1, probe_name: "monitoring_probe")
|
25
|
+
probe.call
|
26
|
+
end
|
22
27
|
end
|
23
28
|
|
24
29
|
describe 'longest_delay' do
|
@@ -72,16 +72,24 @@ describe Roqua::Scheduling::Scheduler do
|
|
72
72
|
describe 'callbacks' do
|
73
73
|
let(:callback_spy) { spy(:callback) }
|
74
74
|
|
75
|
-
|
75
|
+
before do
|
76
76
|
Roqua::Scheduling::Schedule.setup do |cron|
|
77
77
|
cron.add_task 'hourly', next_run_at: proc { 1.minute.ago } do
|
78
78
|
callback_spy.execute
|
79
79
|
end
|
80
80
|
end
|
81
|
+
end
|
81
82
|
|
83
|
+
it 'get executed' do
|
82
84
|
expect(callback_spy).to receive(:execute)
|
83
85
|
subject.ping
|
84
86
|
end
|
87
|
+
|
88
|
+
it 'counts task calls' do
|
89
|
+
expect(Appsignal).to receive(:increment_counter).with('scheduler.completed', 1)
|
90
|
+
expect(Appsignal).to receive(:increment_counter).with('scheduler.run_task.completed', 1, task_name: 'hourly')
|
91
|
+
subject.ping
|
92
|
+
end
|
85
93
|
end
|
86
94
|
|
87
95
|
describe 'when running multiple times' do
|
@@ -94,6 +94,7 @@ describe 'Error reporting' do
|
|
94
94
|
let(:transaction) { double("transaction") }
|
95
95
|
|
96
96
|
before do
|
97
|
+
Appsignal.config = Appsignal::Config.new(Dir.pwd, "test")
|
97
98
|
allow(Appsignal).to receive(:active?).and_return(true)
|
98
99
|
allow(Appsignal).to receive(:is_ignored_exception?).and_return(false)
|
99
100
|
allow(Appsignal).to receive(:agent).and_return(agent)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roqua-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_interaction
|
@@ -30,20 +30,20 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '5.1'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '6'
|
36
|
+
version: '6.1'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '
|
43
|
+
version: '5.1'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '6'
|
46
|
+
version: '6.1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: naught
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,28 +78,34 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 2.
|
82
|
-
|
81
|
+
version: '2.9'
|
82
|
+
- - "<"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '2.11'
|
85
|
+
type: :runtime
|
83
86
|
prerelease: false
|
84
87
|
version_requirements: !ruby/object:Gem::Requirement
|
85
88
|
requirements:
|
86
89
|
- - ">="
|
87
90
|
- !ruby/object:Gem::Version
|
88
|
-
version: 2.
|
91
|
+
version: '2.9'
|
92
|
+
- - "<"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '2.11'
|
89
95
|
- !ruby/object:Gem::Dependency
|
90
96
|
name: bundler
|
91
97
|
requirement: !ruby/object:Gem::Requirement
|
92
98
|
requirements:
|
93
99
|
- - "~>"
|
94
100
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
101
|
+
version: '2.0'
|
96
102
|
type: :development
|
97
103
|
prerelease: false
|
98
104
|
version_requirements: !ruby/object:Gem::Requirement
|
99
105
|
requirements:
|
100
106
|
- - "~>"
|
101
107
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
108
|
+
version: '2.0'
|
103
109
|
- !ruby/object:Gem::Dependency
|
104
110
|
name: delayed_job_active_record
|
105
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,20 +154,6 @@ dependencies:
|
|
148
154
|
- - "<"
|
149
155
|
- !ruby/object:Gem::Version
|
150
156
|
version: '4.0'
|
151
|
-
- !ruby/object:Gem::Dependency
|
152
|
-
name: sqlite3
|
153
|
-
requirement: !ruby/object:Gem::Requirement
|
154
|
-
requirements:
|
155
|
-
- - "~>"
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
version: 1.3.6
|
158
|
-
type: :development
|
159
|
-
prerelease: false
|
160
|
-
version_requirements: !ruby/object:Gem::Requirement
|
161
|
-
requirements:
|
162
|
-
- - "~>"
|
163
|
-
- !ruby/object:Gem::Version
|
164
|
-
version: 1.3.6
|
165
157
|
- !ruby/object:Gem::Dependency
|
166
158
|
name: timecop
|
167
159
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,10 +188,9 @@ files:
|
|
196
188
|
- README.md
|
197
189
|
- Rakefile
|
198
190
|
- circle.yml
|
199
|
-
- gemfiles/rails42.gemfile
|
200
|
-
- gemfiles/rails50.gemfile
|
201
191
|
- gemfiles/rails51.gemfile
|
202
192
|
- gemfiles/rails52.gemfile
|
193
|
+
- gemfiles/rails60.gemfile
|
203
194
|
- lib/roqua-support.rb
|
204
195
|
- lib/roqua-support/railtie.rb
|
205
196
|
- lib/roqua-support/version.rb
|
@@ -266,7 +257,7 @@ homepage: https://github.com/roqua/roqua-support
|
|
266
257
|
licenses:
|
267
258
|
- MIT
|
268
259
|
metadata: {}
|
269
|
-
post_install_message:
|
260
|
+
post_install_message:
|
270
261
|
rdoc_options: []
|
271
262
|
require_paths:
|
272
263
|
- lib
|
@@ -274,16 +265,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
274
265
|
requirements:
|
275
266
|
- - ">="
|
276
267
|
- !ruby/object:Gem::Version
|
277
|
-
version: '
|
268
|
+
version: '2.5'
|
278
269
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
270
|
requirements:
|
280
271
|
- - ">="
|
281
272
|
- !ruby/object:Gem::Version
|
282
273
|
version: '0'
|
283
274
|
requirements: []
|
284
|
-
|
285
|
-
|
286
|
-
signing_key:
|
275
|
+
rubygems_version: 3.1.4
|
276
|
+
signing_key:
|
287
277
|
specification_version: 4
|
288
278
|
summary: Helper objects and proxies used by a lot of RoQua applications
|
289
279
|
test_files:
|
data/gemfiles/rails50.gemfile
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal"
|
6
|
-
gem "roqua_styleguide", :git => "https://gitlab.roqua.nl/roqua/styleguide.git"
|
7
|
-
gem "activesupport", "~> 5.0.0"
|
8
|
-
|
9
|
-
group :test do
|
10
|
-
gem "actionpack", ">= 4.0"
|
11
|
-
gem "active_interaction", "~> 3.0"
|
12
|
-
gem "appsignal"
|
13
|
-
gem "climate_control"
|
14
|
-
gem "combustion", "~> 0.5.2"
|
15
|
-
gem "fakefs", :require => "fakefs/safe"
|
16
|
-
gem "guard-rspec", "~> 4.2.6"
|
17
|
-
gem "responders"
|
18
|
-
gem "rspec-instrumentation-matcher"
|
19
|
-
gem "rspec-rails"
|
20
|
-
end
|
21
|
-
|
22
|
-
gemspec :path => "../"
|