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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ab0a25271ef54c508955c6fe0c19eb94a508176
4
- data.tar.gz: ae39bd9676c08e16f729753aa6b02da800559108
3
+ metadata.gz: 3e739b47324ac118b8eb59d9bf5c90610e2274c8
4
+ data.tar.gz: 6ea8f217be6a85e3307adb65fa0fc292bfb5b675
5
5
  SHA512:
6
- metadata.gz: '0871be3a15bde36de5752167d788b8678ab9769cba1769bda9ec427e1f525d0bdb81c18c128c0d607ee3ee577f79060fa9718c5ea392fe207cb1b9c8d7c2ecab'
7
- data.tar.gz: 1fd3ccdb5bafec62fc77d5a5aba0ef0fef12cf967e08ea7f83f29dcea2507b1b949188d3a9d3893a6416b49822fc3947a9cb4a3756d1c17c63b82898b8f7a216
6
+ metadata.gz: 6f9074db9ca835ecc98a97e4159771d2f4fbcf82721fc2c8ef0ade250bb8dd318e757722bd8bdcab67803e96e54e4fd6da26f52b3cd714d5bed30618a90600f6
7
+ data.tar.gz: 3fa763aca8898d28669a68ec01115fffb9a07e5e9d657c0c29861208948ad4eaecb87493df446d4407805443e7c4fb171a24da741174eaaa6d3f968797fdd8e7
@@ -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}: #{cmd}\n")
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
@@ -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.debug("#{t.name} thread stopped")
59
+ @log.info("Thread #{t.name} terminated in #{((Time.now - tstart) / 60).round(2)}s")
57
60
  end
58
- @log.info("#{@threads.count} routine threads stopped")
61
+ @log.info("Metronome stopped in #{((Time.now - start) / 60).round(2)}s")
59
62
  end
60
63
  end
61
64
  end
@@ -94,15 +94,18 @@ module Zold
94
94
  end
95
95
  end
96
96
  end
97
- @log.debug("Farm started with #{threads} threads at #{host}:#{port}")
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.debug("Thread #{t.name} terminated")
106
+ @log.info("Thread #{t.name} terminated in #{((Time.now - tstart) / 60).round(2)}s")
104
107
  end
105
- @log.debug('Farm stopped')
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
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Zold
26
- VERSION = '0.13.6'.freeze
26
+ VERSION = '0.13.7'.freeze
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.6
4
+ version: 0.13.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko