okcomputer 1.5.1 → 1.6.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 +4 -4
- data/README.markdown +9 -1
- data/lib/ok_computer/check_collection.rb +14 -1
- data/lib/ok_computer/configuration.rb +4 -0
- data/lib/ok_computer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba26aa7d1aae0bf9b154790df6ba99e372d0f606
|
4
|
+
data.tar.gz: 7db32126e1e5b5fde960295be65164932527a058
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 667ec6c4c321a586c276389960bb77b65bc1a21780b90c4fd451a394762bd27cb897dd4da0db97883ca7f32a1219a939650bebee509872474efed8693e9b3e52
|
7
|
+
data.tar.gz: f5d736b22f60ddd1cdd8e0c2b1c2216289af0eccbf5446280e242d00d7c23c9375576bf3c1431edaf4e37419b1e4866dd4a62d12fbae3211c67b29265209115f
|
data/README.markdown
CHANGED
@@ -119,6 +119,15 @@ end
|
|
119
119
|
OkComputer::Registry.register "check_for_odds", MyCustomCheck.new
|
120
120
|
```
|
121
121
|
|
122
|
+
## Running checks in parallel
|
123
|
+
|
124
|
+
By default, OkComputer runs checks in sequence. If you'd like to run them in parallel, you can configure it with:
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
# config/initializers/okcomputer.rb
|
128
|
+
OkComputer.check_in_parallel = true
|
129
|
+
```
|
130
|
+
|
122
131
|
## Performing Checks
|
123
132
|
|
124
133
|
* Perform a simple up check: http://example.com/okcomputer
|
@@ -150,4 +159,3 @@ OkComputer.analytics_ignore = false
|
|
150
159
|
5. Create new Pull Request
|
151
160
|
|
152
161
|
[fitter-happier]:https://rubygems.org/gems/fitter-happier
|
153
|
-
|
@@ -12,7 +12,7 @@ module OkComputer
|
|
12
12
|
|
13
13
|
# Public: Run the registry's checks
|
14
14
|
def run
|
15
|
-
|
15
|
+
OkComputer.check_in_parallel ? check_in_parallel : check_in_sequence
|
16
16
|
end
|
17
17
|
|
18
18
|
# Public: The list of checks in the collection
|
@@ -48,5 +48,18 @@ module OkComputer
|
|
48
48
|
def success?
|
49
49
|
checks.all?(&:success?)
|
50
50
|
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def check_in_sequence
|
55
|
+
checks.each(&:run)
|
56
|
+
end
|
57
|
+
|
58
|
+
def check_in_parallel
|
59
|
+
threads = checks.map do |check|
|
60
|
+
Thread.new { check.run }
|
61
|
+
end
|
62
|
+
threads.each(&:join)
|
63
|
+
end
|
51
64
|
end
|
52
65
|
end
|
@@ -45,6 +45,10 @@ module OkComputer
|
|
45
45
|
mattr_accessor :mount_at
|
46
46
|
self.mount_at = 'okcomputer'
|
47
47
|
|
48
|
+
# Public: whether to execute checks in parallel.
|
49
|
+
mattr_accessor :check_in_parallel
|
50
|
+
self.check_in_parallel = false
|
51
|
+
|
48
52
|
# Public: Option to disable third-party app performance tools (.e.g NewRelic) from counting OkComputer routes towards their total.
|
49
53
|
mattr_accessor :analytics_ignore
|
50
54
|
self.analytics_ignore = true
|
data/lib/ok_computer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: okcomputer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Byrne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|