zold 0.13.6 → 0.13.7
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/lib/zold/commands/node.rb +4 -1
- data/lib/zold/metronome.rb +5 -2
- data/lib/zold/node/farm.rb +6 -3
- data/lib/zold/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e739b47324ac118b8eb59d9bf5c90610e2274c8
|
4
|
+
data.tar.gz: 6ea8f217be6a85e3307adb65fa0fc292bfb5b675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f9074db9ca835ecc98a97e4159771d2f4fbcf82721fc2c8ef0ade250bb8dd318e757722bd8bdcab67803e96e54e4fd6da26f52b3cd714d5bed30618a90600f6
|
7
|
+
data.tar.gz: 3fa763aca8898d28669a68ec01115fffb9a07e5e9d657c0c29861208948ad4eaecb87493df446d4407805443e7c4fb171a24da741174eaaa6d3f968797fdd8e7
|
data/lib/zold/commands/node.rb
CHANGED
@@ -168,6 +168,7 @@ module Zold
|
|
168
168
|
private
|
169
169
|
|
170
170
|
def exec(cmd, nohup_log)
|
171
|
+
start = Time.now
|
171
172
|
Open3.popen2e(cmd) do |stdin, stdout, thr|
|
172
173
|
nohup_log.print("Started process ##{thr.pid} from process ##{Process.pid}: #{cmd}\n")
|
173
174
|
stdin.close
|
@@ -179,8 +180,10 @@ module Zold
|
|
179
180
|
end
|
180
181
|
nohup_log.print(line)
|
181
182
|
end
|
183
|
+
nohup_log.print("Nothing else left to read from ##{thr.pid}\n")
|
182
184
|
code = thr.value.to_i
|
183
|
-
nohup_log.print("Exit code of process ##{thr.pid} is #{code}
|
185
|
+
nohup_log.print("Exit code of process ##{thr.pid} is #{code}, was alive for \
|
186
|
+
#{((Time.now - start) / (60 * 60)).round} min: #{cmd}\n")
|
184
187
|
raise unless code.zero?
|
185
188
|
end
|
186
189
|
end
|
data/lib/zold/metronome.rb
CHANGED
@@ -51,11 +51,14 @@ module Zold
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def stop
|
54
|
+
@log.info("Terminating the metronome with #{@threads.count} threads...")
|
55
|
+
start = Time.now
|
54
56
|
@threads.each do |t|
|
57
|
+
tstart = Time.now
|
55
58
|
t.exit
|
56
|
-
@log.
|
59
|
+
@log.info("Thread #{t.name} terminated in #{((Time.now - tstart) / 60).round(2)}s")
|
57
60
|
end
|
58
|
-
@log.info("#{
|
61
|
+
@log.info("Metronome stopped in #{((Time.now - start) / 60).round(2)}s")
|
59
62
|
end
|
60
63
|
end
|
61
64
|
end
|
data/lib/zold/node/farm.rb
CHANGED
@@ -94,15 +94,18 @@ module Zold
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
97
|
-
@log.
|
97
|
+
@log.info("Farm started with #{threads} threads at #{host}:#{port}")
|
98
98
|
end
|
99
99
|
|
100
100
|
def stop
|
101
|
+
@log.info("Terminating the farm with #{@threads.count} threads...")
|
102
|
+
start = Time.now
|
101
103
|
@threads.each do |t|
|
104
|
+
tstart = Time.now
|
102
105
|
t.exit
|
103
|
-
@log.
|
106
|
+
@log.info("Thread #{t.name} terminated in #{((Time.now - tstart) / 60).round(2)}s")
|
104
107
|
end
|
105
|
-
@log.
|
108
|
+
@log.info("Farm stopped in #{((Time.now - start) / 60).round(2)}s")
|
106
109
|
end
|
107
110
|
|
108
111
|
private
|
data/lib/zold/version.rb
CHANGED