Skip to content

Commit 1235276

Browse files
committed
Native image reflection config for HdrHistogram usage
Our client-side percentiles use HdrHistogram as an implementation detail. That library uses some reflection that fails at runtime in a native image without this reflection config. Ideally, the HdrHistogram library would work in native images out-of-the-box by, for example, having this reflection config in its published JAR. In the meantime, we will add the necessary config to Micrometer to provide a better experience for our users compiling to native images and using client-side percentiles. With this, users should not need to add any configuration or hints themselves to use Micrometer in their native image applications. Resolves gh-3002
1 parent daab34b commit 1235276

File tree

1 file changed

+8
-0
lines changed
  • micrometer-core/src/main/resources/META-INF/native-image/io.micrometer/micrometer-core

1 file changed

+8
-0
lines changed

micrometer-core/src/main/resources/META-INF/native-image/io.micrometer/micrometer-core/reflect-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,13 @@
1212
{"name":"getMaxFileDescriptorCount","parameterTypes":[] },
1313
{"name":"getOpenFileDescriptorCount","parameterTypes":[] }
1414
]
15+
},
16+
{
17+
"name":"org.HdrHistogram.ConcurrentHistogram",
18+
"methods":[{"name":"<init>","parameterTypes":["long","long","int"] }]
19+
},
20+
{
21+
"name":"org.HdrHistogram.Histogram",
22+
"methods":[{"name":"<init>","parameterTypes":["long","long","int"] }]
1523
}
1624
]

0 commit comments

Comments
 (0)