We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Temporal should provide a sample for users on how they may check the metrics in unit tests. I propose to wire MetricsScope with our standard MicrometerClientStatsReporter initialized with SimpleMeterRegistry micrometer. A little bit like micrometer does in one of their tests: https://www.programcreek.com/java-api-examples/?code=micrometer-metrics%2Fmicrometer%2Fmicrometer-master%2Fmicrometer-test%2Fsrc%2Fmain%2Fjava%2Fio%2Fmicrometer%2Fcore%2Ftck%2FTimerTest.java
MeterRegistry registry = new SimpleMeterRegistry(); try (Timer.ResourceSample sample = Timer.resource(registry, "requests") .description("This is an operation") .publishPercentileHistogram()) { try { if (outcome.equals("error")) { throw new IllegalArgumentException("boom"); } sample.tag("outcome", "success"); } catch (Throwable t) { sample.tag("outcome", "error"); } } assertThat(registry.get("requests").tag("outcome", outcome).timer().count()) .isEqualTo(1);
The text was updated successfully, but these errors were encountered:
Since then I used this approach in SDK tests for metrics and it worked out quite fine. This is an example of using this approach in Temporal code: https://github.com/temporalio/sdk-java/blob/37a0e463fae2312882b5c946f423a0dbf85f9666/temporal-sdk/src/test/java/io/temporal/client/functional/MetricsTest.java#L76
Sorry, something went wrong.
Thank you @Spikhalskiy , I have started to work on this
tsurdilo
No branches or pull requests
Temporal should provide a sample for users on how they may check the metrics in unit tests.
I propose to wire MetricsScope with our standard MicrometerClientStatsReporter initialized with SimpleMeterRegistry micrometer.
A little bit like micrometer does in one of their tests:
https://www.programcreek.com/java-api-examples/?code=micrometer-metrics%2Fmicrometer%2Fmicrometer-master%2Fmicrometer-test%2Fsrc%2Fmain%2Fjava%2Fio%2Fmicrometer%2Fcore%2Ftck%2FTimerTest.java
The text was updated successfully, but these errors were encountered: