ducksboard_reporter 0.1.3 → 0.1.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0682a00c41379d6b61494c5a885a575a785eca6d
|
4
|
+
data.tar.gz: 826626df89bccda89f5a95d5d7c7884816fb904e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38eeab3e83a6bbf673c477d921346dc066b9655c8b1fbf665af4321e608bf13281917325bda1b25824ae9f48f93282ba253e5cc0664df2131275a33fb7097167
|
7
|
+
data.tar.gz: 5d607d9e6a6f53ab3bf0b419ab4153174825a72a88943f3624b0796338b9aa5251f586943dde55a461efc02c890af202421b4c8d2ffb9286c2a997462862c540
|
data/example_config.yml
CHANGED
@@ -5,27 +5,18 @@ module DucksboardReporter
|
|
5
5
|
|
6
6
|
def initialize(path)
|
7
7
|
@path = path
|
8
|
-
@timestamp = Time.now.to_i
|
9
8
|
end
|
10
9
|
|
11
10
|
def run
|
12
11
|
open_file
|
13
12
|
|
14
13
|
while true do
|
15
|
-
if (current_time = Time.now.to_i) > @timestamp # flush every second
|
16
|
-
@every_second_block.call(current_time)
|
17
|
-
@timestamp = current_time
|
18
|
-
end
|
19
|
-
|
20
14
|
IO.select([@file])
|
21
15
|
line = @file.gets
|
22
16
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
raise Errno::ENOENT unless File.exists?(@path)
|
27
|
-
sleep 0.001
|
28
|
-
end
|
17
|
+
@line_block.call(line)
|
18
|
+
|
19
|
+
raise Errno::ENOENT if line.nil? && !File.exists?(@path)
|
29
20
|
end
|
30
21
|
rescue Errno::ENOENT
|
31
22
|
sleep 0.1
|
@@ -15,7 +15,7 @@ module DucksboardReporter
|
|
15
15
|
return
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
every(1) do
|
19
19
|
@requests, requests = requests, 0
|
20
20
|
@nosrvs, nosrvs = nosrvs, 0
|
21
21
|
end
|
@@ -26,6 +26,8 @@ module DucksboardReporter
|
|
26
26
|
nosrvs += 1
|
27
27
|
when /./
|
28
28
|
requests += 1
|
29
|
+
else
|
30
|
+
sleep 0.1
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|