gn_crossmap 3.3.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94a484698915810c34397b63d22a7c27febd2a65
4
- data.tar.gz: 5fe783ff2bf35ad569d1be0393ffbf32fdf910a5
3
+ metadata.gz: 17c1750e71b66ba0d13b76a4acaa110f00b7cdd0
4
+ data.tar.gz: 96f3b4d6955c10724f78749c99d9c0414da21278
5
5
  SHA512:
6
- metadata.gz: 216221d07d2fdb278c69f8c40ec36f6811f8adfbf8163ed86e8ee53b051d0d42d3b6dc309efee736da2adc5a038a5df9ec997ba845edf456c6e5c57a01cef1e4
7
- data.tar.gz: 7adc10873cb2bebffc709541a0ef9238e9cce71f82e5c2980b5d14ded3332fc3533a2a96da7fa8be5db515dfae429578be8e0b7df9b9969f0c625e96c40e4ce9
6
+ metadata.gz: 874afab0ba3e3c7e847ebcb8a86c439bcdcc56ab84ae86b0d5dc1912cd7dd8dff7fefa5bc0d031a082b9b854c11714879db44568edf79bcc698ba8337a633b9e
7
+ data.tar.gz: 4cff3ac93255cd203ef4c2e9083ff1da6babb94a6367afb244c38e743c23be620fb154aad8e7deed818c16ada4f7ad0b78643123b72dd2c54798cafa8f70728e
@@ -1,5 +1,9 @@
1
1
  # ``gn_crossmap`` CHANGELOG
2
2
 
3
+ ## 4.0.0
4
+
5
+ * @dimus - Better estimation for time left for resolver and speed
6
+
3
7
  ## 3.3.1
4
8
 
5
9
  * @dimus - Better error message in logger
data/README.md CHANGED
@@ -163,7 +163,8 @@ end
163
163
  |resolution_stop |time when resolution of names stopped |
164
164
  |resolution_span |time of intermediate checkpoint of resolving names |
165
165
  |resolved_records |number of names already processed |
166
- |last_batches_time |time required to process the last batch of names |
166
+ |speed |weighted speed average |
167
+ |current_speed |speed of resolution for the last batch |
167
168
  |matches |Distribution of processed data by match type (see below) |
168
169
  |errors |First 0-10 errors found during the csv file processing |
169
170
 
@@ -14,6 +14,7 @@ module GnCrossmap
14
14
  @count = 0
15
15
  @jobs = []
16
16
  @batch = 200
17
+ @smoothing = 0.05
17
18
  end
18
19
 
19
20
  def resolve(data)
@@ -87,10 +88,13 @@ module GnCrossmap
87
88
  # rubocop:disable Metrics/AbcSize
88
89
  def update_stats(job_stats)
89
90
  s = @stats.stats
90
- s[:last_batches_time].shift if s[:last_batches_time].size > 2
91
- s[:last_batches_time] << job_stats.stats[:last_batches_time][0]
91
+ s[:current_speed] = job_stats.stats[:current_speed]
92
+ s[:speed] = s[:current_speed] * @threads unless s[:speed]
93
+ s[:speed] = s[:speed] * (1 - @smoothing) +
94
+ s[:current_speed] * @smoothing * @threads
92
95
  s[:resolution_span] = Time.now - s[:resolution_start]
93
96
  s[:resolved_records] += job_stats.stats[:resolved_records]
97
+ s[:eta] = (s[:total_records] - s[:resolved_records]) / s[:speed]
94
98
  s[:matches][7] += job_stats.stats[:matches][7]
95
99
  end
96
100
  # rubocop:enable all
@@ -121,13 +125,14 @@ module GnCrossmap
121
125
  end
122
126
 
123
127
  def with_log
128
+ yield
124
129
  s = @count + 1
125
130
  @count += @batch
126
131
  e = [@count, @stats.stats[:total_records]].min
127
- GnCrossmap.log("Resolve #{s}-#{e} out of " \
128
- "#{@stats.stats[:total_records]} records at " \
129
- "#{@resolver_url}")
130
- yield
132
+ msg = format("Resolve %s-%s/%s records %d rec/s; eta: %d", s, e,
133
+ @stats.stats[:total_records], @stats.stats[:speed],
134
+ @stats.stats[:eta].to_i + Time.now.to_i)
135
+ GnCrossmap.log(msg)
131
136
  end
132
137
  end
133
138
  end
@@ -54,7 +54,7 @@ module GnCrossmap
54
54
  end
55
55
 
56
56
  def stats_add_batch_time(batch_start)
57
- @stats.stats[:last_batches_time] << Time.now - batch_start
57
+ @stats.stats[:current_speed] = @batch_data.size / (Time.now - batch_start)
58
58
  end
59
59
  end
60
60
  end
@@ -10,8 +10,8 @@ module GnCrossmap
10
10
  resolved_records: 0, ingestion_span: nil,
11
11
  resolution_span: nil, ingestion_start: nil,
12
12
  resolution_start: nil, resolution_stop: nil,
13
- last_batches_time: [], matches: match_types,
14
- errors: [] }
13
+ speed: nil, current_speed: nil, eta: nil,
14
+ matches: match_types, errors: [] }
15
15
  end
16
16
 
17
17
  private
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Namespace module for crossmapping checklists to GN sources
4
4
  module GnCrossmap
5
- VERSION = "3.3.1"
5
+ VERSION = "4.0.0"
6
6
 
7
7
  def self.version
8
8
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gn_crossmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-12 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: biodiversity