Skip to content

Adds a toJSON and fromJSON route for serialization#31

Open
orta wants to merge 1 commit into
DataDog:masterfrom
orta:json-serialise
Open

Adds a toJSON and fromJSON route for serialization#31
orta wants to merge 1 commit into
DataDog:masterfrom
orta:json-serialise

Conversation

@orta

@orta orta commented Nov 13, 2025

Copy link
Copy Markdown

This PR adds two new functions to the DDSketch class which converts down into a very compact JSON format for de/serialization. I've found in testing they end up being about 1kb of JSON data. The codes a bit verbose, but I figured more error checking is better.

I added some tests to verify that the process is not lossy

As I'm in no rush to get it merged, I've released it on npm under my namespace too - www.npmjs.com/package/@orta/sketches-js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant