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
Add TypeFactory cache instrumentation #2588
Conversation
Generate changelog in
|
type: histogram | ||
tags: | ||
- format | ||
docs: Histogram describing the length of strings parsed from input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a rename to jackson-metrics
since -registry
didn't make a lot of sense in the filename.
long hits = hit.getCount() - hitBefore; | ||
long misses = miss.getCount() - missBefore; | ||
|
||
assertThat(hits).isGreaterThan(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be 0 hits?
assertThat(hits).isGreaterThan(0); | |
assertThat(hits).isZero(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internally this ends up around 3 due to various components mapping the same type. It's probably best not to make any asserts at all at this point, then assert the value has increased in the second round
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the test to operate directly on the TypeFactory since the ObjectMapper complicates things
missBefore = miss.getCount(); | ||
mapper.writeValue(ByteStreams.nullOutputStream(), new SimpleSerializable()); | ||
misses = miss.getCount() - missBefore; | ||
assertThat(misses).isZero(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check that hits > 0 here?
assertThat(misses).isZero(); | |
assertThat(hit.getCount() - hits).isGreaterThan(0); |
Released 7.49.0 |
==COMMIT_MSG==
Add TypeFactory cache instrumentation
==COMMIT_MSG==