fix lost prometheus metric in OrderedExecutor #4374
fix lost prometheus metric in OrderedExecutor #4374hezhangjian merged 1 commit intoapache:masterfrom
Conversation
|
@merlimat Could you take a look of this problem? |
hezhangjian
left a comment
There was a problem hiding this comment.
Nice catch.
I think we can change createSingleThreadExecutor return SingleThreadExecutor directly.
BTW, I prefer split this pr, one to fix problem, one to modify the metric name.
StevenLuMT
left a comment
There was a problem hiding this comment.
LGTM,
I think this kind of metric change require adding a testcase to cover it
ok, I would split to 2 pr. But I guess we can't change |
6814b3c to
aa3ee80
Compare
hezhangjian
left a comment
There was a problem hiding this comment.
Would you mind update the description since we split the PR? I would be glad to proceed with the merge once the updates are made.
|
Thanks for your contribution. :) |
| new ThreadFactoryBuilder().setNameFormat(name + "-" + getClass().getSimpleName() + "-" + i + "-%d") | ||
| .setThreadFactory(threadFactory).build()); | ||
| SingleThreadExecutor ste = null; | ||
| if (thread instanceof SingleThreadExecutor) { |
There was a problem hiding this comment.
We can registerMetrics here instead of the instanceOf check
There was a problem hiding this comment.
Do you mean that remove the check if (thread instanceof SingleThreadExecutor) directly ?
But createSingleThreadExecutor() is also triggered in OrderedScheduler. In OrderedScheduler, createSingleThreadExecutor() do not return SingleThreadExecutor, so I keep the check here.
Fix [apache#4373](apache#4373) ### Motivation As shown in the issue. This is the first pr to fix the lost metric problem. And the other pr improve the metric in SingleThreadExecutor. Co-authored-by: fanjianye <fanjianye@bigo.sg>
Descriptions of the changes in this PR:
Fix #4373
Motivation
As shown in the issue.
This is the first pr to fix the lost metric problem. And the other pr improve the metric in SingleThreadExecutor.
Changes
If we only fix the problem but do not change the metric , the metric is as follow, the metric become visible, though the format is not same.