Sample for a test verifying published metrics in unit tests
@tsurdilo 已经在做这个了。
开始于 2022年5月9日。
评估
这个 Issue 还没有评估数据。
描述
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);
- 主要语言
- Java
- 星标
- 258
- 派生
- 189
- 平均合并
- 6 天 4 小时
- 30 天内合并 PR
- 4
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
temporalio/samples-java 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
temporalio/samples-java#770 ·
-
bug
难度 3/5 1-2 天 新手友好度 45/100
temporalio/samples-java#749 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
temporalio/samples-java#687 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 35/100
temporalio/samples-java#635 · 1 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
temporalio/samples-java#606 · 4 个 reaction ·
查看 temporalio/samples-java 的全部 Issue
相似的 Issue
-
Bug Java Platform: Java
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-java#6138 · 1 条评论 ·
-
bug needs triage p2
难度 2/5 1-3 小时 新手友好度 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 条评论 ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apache/rocketmq-dashboard#4654 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 76/100