waylon-core 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/waylon/skills/diagnostics.rb +19 -9
- data/lib/waylon/storage.rb +4 -0
- data/lib/waylon/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 404fb7180c3c7b52c2bb3637fd3fb86d28cd5b4b1f1791e8b2fe0f94d7788ea9
|
4
|
+
data.tar.gz: 6b1da741b15a5092cddf65e81623a348454289ecb496eef1dfee081e79bb5f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4852c99d93a726be2e21ec1a1cdf9fdf758508b09fed717ea1642b2f92c9c9adfe84e8fb922107f751859d2e3a331521d32f492911ffb6f5d82935a0ceef032
|
7
|
+
data.tar.gz: 03747526f39170835b3ab67ffc294a3e3c914968001b40e24eb5ddcd74fb2746c28ca7bb95288ab67523cf25018fe9709aa16956a54ab507839b1fe05a252771
|
data/Gemfile.lock
CHANGED
@@ -23,10 +23,10 @@ module Waylon
|
|
23
23
|
response << "*Skill plugins:*"
|
24
24
|
loaded_routes.each { |d| response << " - #{d}" }
|
25
25
|
response << "*Redis:*"
|
26
|
-
state, read_time, write_time = test_redis
|
26
|
+
state, raw_read_time, raw_write_time, read_time, write_time = test_redis
|
27
27
|
response << " - *Test Result:* #{state ? "Success" : "Error"}"
|
28
|
-
response << " - *Read time:* #{read_time}s"
|
29
|
-
response << " - *Write time:* #{write_time}s"
|
28
|
+
response << " - *Read time:* #{read_time}s (raw: #{raw_read_time}s)"
|
29
|
+
response << " - *Write time:* #{write_time}s (raw: #{raw_write_time}s)"
|
30
30
|
if Resque.redis.connected?
|
31
31
|
response << "*Queue Monitoring:*"
|
32
32
|
response << " - Failed jobs: #{Resque::Failure.count}"
|
@@ -43,17 +43,27 @@ module Waylon
|
|
43
43
|
SenseRegistry.instance.senses.map { |_s, c| c.name }.sort.uniq
|
44
44
|
end
|
45
45
|
|
46
|
-
def test_redis
|
47
|
-
|
46
|
+
def test_redis # rubocop:disable Metrics/AbcSize
|
47
|
+
test_key1 = ("a".."z").to_a.sample(10).join
|
48
|
+
test_key2 = ("a".."z").to_a.sample(10).join
|
48
49
|
test_value = (0..1000).to_a.sample(20).map(&:to_s).join
|
49
50
|
test_result = nil
|
50
51
|
|
51
|
-
|
52
|
-
|
52
|
+
raw_write_time = Benchmark.realtime { cache(test_key1) { test_value } }
|
53
|
+
raw_read_time = Benchmark.realtime { cache(test_key1) { test_value } }
|
54
|
+
enc_write_time = Benchmark.realtime { db.store(test_key2, test_value) }
|
55
|
+
enc_read_time = Benchmark.realtime { test_result = db.load(test_key2) }
|
53
56
|
|
54
|
-
db.delete(
|
57
|
+
db.delete(test_key1)
|
58
|
+
db.delete(test_key2)
|
55
59
|
|
56
|
-
[
|
60
|
+
[
|
61
|
+
(test_value == test_result),
|
62
|
+
raw_read_time.round(6),
|
63
|
+
raw_write_time.round(6),
|
64
|
+
enc_read_time.round(6),
|
65
|
+
enc_write_time.round(6)
|
66
|
+
]
|
57
67
|
end
|
58
68
|
end
|
59
69
|
end
|
data/lib/waylon/storage.rb
CHANGED
data/lib/waylon/version.rb
CHANGED