HDRHistogram 0.1.6 → 0.1.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/HDRHistogram.rb +15 -8
- data/lib/HDRHistogram/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d475c4c4cbb66898aeff2e9dfdeccbaf9b8e7e000920332076a63b05191ccc6f
|
|
4
|
+
data.tar.gz: a409b91d6a9fe2dd87ed4e4e74f2f6425dbea2743901540bcd0908915b1861ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4733bc0361f91f457b3fe462cac735296e9190a69f95cb8aab09ec864dec9e4da91e3935aae26f240397e7504bf3310da2e3f29d842dfb75c4c8a631efd39e4c
|
|
7
|
+
data.tar.gz: 4f1ec7b4af487e4a7034e1d552959dd3326757a9ac3760bb664779ec2ef73cc5284a644b241d43d76cb2bee47b4b48e33f70087cd9da020a640df086b0d39067
|
data/lib/HDRHistogram.rb
CHANGED
|
@@ -18,23 +18,30 @@ class HDRHistogram
|
|
|
18
18
|
self.max_value= m[:max_value].to_i
|
|
19
19
|
self.normalizing_index_offset= m[:normalizing_index_offset].to_i
|
|
20
20
|
self.conversion_ratio= m[:conversion_ratio].to_f
|
|
21
|
-
|
|
21
|
+
counts_len = m[:counts_len].to_i
|
|
22
|
+
self.counts_len= counts_len
|
|
22
23
|
self.total_count= m[:total_count].to_i
|
|
23
24
|
|
|
24
25
|
counts = m[:counts].split " "
|
|
25
26
|
i=0
|
|
27
|
+
shorted = 0
|
|
26
28
|
counts.each do |count|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
nf="~!@#$%^&*"
|
|
30
|
+
m = count.match /^([#{nf}])(\d+)$/
|
|
31
|
+
if m && nf.index(m[1])
|
|
32
|
+
shorted += 1
|
|
33
|
+
m[2].to_i.times do
|
|
34
|
+
set_raw_count(i, nf.index(m[1]))
|
|
35
|
+
i+=1
|
|
32
36
|
end
|
|
33
37
|
else
|
|
34
38
|
set_raw_count(i, count.to_i)
|
|
35
|
-
i
|
|
39
|
+
i+=1
|
|
36
40
|
end
|
|
37
41
|
end
|
|
42
|
+
if counts_len != i
|
|
43
|
+
raise HDRHistogramError, "invalid serialization pattern: total count doesn't match, expected: #{counts_len}, found #{i} (diff: #{counts_len - i}), counts.count: #{counts.count}, shorted: #{shorted}"
|
|
44
|
+
end
|
|
38
45
|
end
|
|
39
46
|
end
|
|
40
47
|
|
|
@@ -98,7 +105,7 @@ class HDRHistogram
|
|
|
98
105
|
private_class_method :adjusted_boundary_val
|
|
99
106
|
|
|
100
107
|
def self.unserialize(str, opt={})
|
|
101
|
-
regex = /^(?<lowest_trackable_value>\d+) (?<highest_trackable_value>\d+) (?<unit_magnitude>\d+) (?<significant_figures>\d+) (?<sub_bucket_half_count_magnitude>\d+) (?<sub_bucket_half_count>\d+) (?<sub_bucket_mask>\d+) (?<sub_bucket_count>\d+) (?<bucket_count>\d+) (?<min_value>\d+) (?<max_value>\d+) (?<normalizing_index_offset>\d+) (?<conversion_ratio>\S+) (?<counts_len>\d+) (?<total_count>\d+) \[(?<counts>[
|
|
108
|
+
regex = /^(?<lowest_trackable_value>\d+) (?<highest_trackable_value>\d+) (?<unit_magnitude>\d+) (?<significant_figures>\d+) (?<sub_bucket_half_count_magnitude>\d+) (?<sub_bucket_half_count>\d+) (?<sub_bucket_mask>\d+) (?<sub_bucket_count>\d+) (?<bucket_count>\d+) (?<min_value>\d+) (?<max_value>\d+) (?<normalizing_index_offset>\d+) (?<conversion_ratio>\S+) (?<counts_len>\d+) (?<total_count>\d+) \[(?<counts>([~!@#$%^&*]?\d+ )+)\]/
|
|
102
109
|
|
|
103
110
|
m = str.match regex
|
|
104
111
|
|
data/lib/HDRHistogram/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: HDRHistogram
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Leo P.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-09-
|
|
11
|
+
date: 2018-09-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|