Skip to content

Commit f60a9fe

Browse files
committed
Deserialize histograms to statsbase type
1 parent cdb0d71 commit f60a9fe

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Deserialization/histograms.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ function deserialize_histogram_summary(summary)
55
val = reshape(summary.histo.bucket,
66
reinterpret(Int,
77
summary.metadata.plugin_data.content)...)
8-
else
9-
val = summary.histo
8+
9+
return val
1010
end
11-
else
12-
val = summary.histo
1311
end
1412

15-
return val
13+
# deserialize histogramproto
14+
hist_proto = summary.histo
15+
bin_edges = similar(hist_proto.bucket_limit, length(hist_proto.bucket_limit)+1)
16+
bin_edges[1] = hist_proto.min
17+
bin_edges[2:end] .= hist_proto.bucket_limit
18+
19+
return Histogram(bin_edges, hist_proto.bucket)
1620
end
1721

1822
# Lookahead for histograms .

0 commit comments

Comments
 (0)