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

Add reflection config for ConcurrentHistogram(AbstractHistogram) #238

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@
],
"name": "org.HdrHistogram.ConcurrentHistogram"
},
{
"condition": {
"typeReachable": "org.HdrHistogram.ConcurrentHistogram"
},
"methods": [
{
"name": "<init>",
"parameterTypes": [
"org.HdrHistogram.AbstractHistogram"
]
}
],
"name": "org.HdrHistogram.ConcurrentHistogram"
},
{
"condition": {
"typeReachable": "org.HdrHistogram.DoubleHistogram"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.HdrHistogram.ConcurrentDoubleHistogram;
import org.HdrHistogram.ConcurrentHistogram;
import org.HdrHistogram.DoubleHistogram;
import org.HdrHistogram.DoubleRecorder;
import org.HdrHistogram.EncodableHistogram;
import org.HdrHistogram.Histogram;
import org.HdrHistogram.IntCountsHistogram;
Expand Down Expand Up @@ -46,6 +47,11 @@ void test() throws Exception {
encodeDecode(new SynchronizedHistogram(0), SynchronizedHistogram::decodeFromCompressedByteBuffer);
}

@Test
void testReflectionWithConcurrentHistogramConstructorWithAbstractHistogram() throws Exception {
new DoubleRecorder(0).getIntervalHistogramInto(new DoubleHistogram(0));
}

private void encodeDecode(EncodableHistogram histogram, Decoder decoder) throws DataFormatException {
ByteBuffer buffer = ByteBuffer.allocate(histogram.getNeededByteBufferCapacity());
histogram.encodeIntoCompressedByteBuffer(buffer, 0);
Expand Down