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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -1
- data/lib/gn_crossmap/resolver.rb +11 -6
- data/lib/gn_crossmap/resolver_job.rb +1 -1
- data/lib/gn_crossmap/stats.rb +2 -2
- data/lib/gn_crossmap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17c1750e71b66ba0d13b76a4acaa110f00b7cdd0
|
4
|
+
data.tar.gz: 96f3b4d6955c10724f78749c99d9c0414da21278
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 874afab0ba3e3c7e847ebcb8a86c439bcdcc56ab84ae86b0d5dc1912cd7dd8dff7fefa5bc0d031a082b9b854c11714879db44568edf79bcc698ba8337a633b9e
|
7
|
+
data.tar.gz: 4cff3ac93255cd203ef4c2e9083ff1da6babb94a6367afb244c38e743c23be620fb154aad8e7deed818c16ada4f7ad0b78643123b72dd2c54798cafa8f70728e
|
data/CHANGELOG.md
CHANGED
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
|
-
|
|
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
|
|
data/lib/gn_crossmap/resolver.rb
CHANGED
@@ -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[:
|
91
|
-
s[:
|
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
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
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
|
data/lib/gn_crossmap/stats.rb
CHANGED
@@ -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
|
-
|
14
|
-
errors: [] }
|
13
|
+
speed: nil, current_speed: nil, eta: nil,
|
14
|
+
matches: match_types, errors: [] }
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
data/lib/gn_crossmap/version.rb
CHANGED
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:
|
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-
|
11
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: biodiversity
|