Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvement to Size, Duration, make jackson serializable #96

Closed
cowtowncoder opened this issue May 21, 2012 · 5 comments
Closed

Comments

@cowtowncoder
Copy link
Contributor

I noticed that two types, Size and Duration, are not by default serializable with Jackson. But it looks like 'toString()' method would work well, so the fix would be as simple as adding @JsonValue for 'toString()' methods. I assume this is ok since there is already @JsonCreator used; otherwise we could almost as easily create custom serializers, which is what I do locally.

My specific use case is debugging: I just want to print out Configuration object as JSON during startup.

Related to this, I guess it might be also useful to expose config object itself via GUI (similar to /threads etc); but I leave that for future improvements. :-)
(further ahead, really trying to dig into Jetty setup, JMX exposes only subset... but I digress).

Let me know if you want a patch (I realize that a unit test would be good, esp. for round-tripping); fix itself is trivial.

@codahale
Copy link
Contributor

I'd absolutely merge a patch for this.

@cowtowncoder
Copy link
Contributor Author

:-D

Ok, I'll add annotations first. On admin page(s): where do things like /threads get wired in? I #fail'd to find it.

@codahale
Copy link
Contributor

Those are in Metrics, actually.

@cowtowncoder
Copy link
Contributor Author

Ok. Makes sense, one of the paths did lead there...

@codahale
Copy link
Contributor

Fixed in 9c8b7d7.

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

No branches or pull requests

2 participants