histogram icon indicating copy to clipboard operation
histogram copied to clipboard

Histogram is not Serializable

Open antonioalegria opened this issue 11 years ago • 6 comments

When trying to serialize a Histogram I get a NotSerializableException. This seems like a pretty simple object, serialization should be a trivial matter.

Since these Histograms serve to summarize pretty huge datasets, it's an important feature to serialize them for re-use after a service restart.

Thank you

antonioalegria avatar Mar 04 '14 15:03 antonioalegria

Ok, I see Histograms support a toJSON method. That's good enough

antonioalegria avatar Mar 06 '14 11:03 antonioalegria

Actually, the toJSON methods are not enough - there isnt a fromJSON to convert back...

What would be the best course to implement SerDe for Histograms?

antonioalegria avatar Mar 06 '14 17:03 antonioalegria

+1 on this, I'd like to be able to run an experiment once and distribute the results for analysis.

yayitswei avatar Mar 26 '14 06:03 yayitswei

I had to do this manually, it wasn't that hard actually (just store the Bins and reset them afterwards) for a simple usecase where I'm using simple targets.

For more involved use cases it would really be helpful to just have serialization support.

antonioalegria avatar Mar 31 '14 10:03 antonioalegria

If you're using Clojure, the hist-to-clj and clj-to-hist functions can serialize a Histogram to native Clojure data structures (which are JSON friendly). But you're right that serialization for Java users is lacking.

I have some other tasks to get out of the way, but I'll look into supporting Java serialization soon... probably in a week or so.

ashenfad avatar Apr 01 '14 21:04 ashenfad

My english is not very good.Maybe I missed some important information.I am cofused about why the histogram looks more like line chart. Can you explain it to me? thx

Mrfuture1 avatar Nov 05 '15 13:11 Mrfuture1