-
Notifications
You must be signed in to change notification settings - Fork 858
[#513] Virtual thread pin event metric and alarm #517
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
base: springboot3-dev
Are you sure you want to change the base?
Changes from 19 commits
9704b33
7e88a92
b938353
b4ee485
0496aa5
15eaaef
8e02eb6
10cfe76
8f74435
10c87d5
3a27975
a603965
939a119
e7236f2
c1a5867
d908db4
332bbde
9016df4
d74a64e
7d2b2f9
782159b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,12 @@ public enum NotifyItemEnum { | |
/** | ||
* Task queue wait timeout alarm. | ||
*/ | ||
QUEUE_TIMEOUT("queue_timeout", ""); | ||
QUEUE_TIMEOUT("queue_timeout", ""), | ||
|
||
/** | ||
* Pin timeout alarm. | ||
*/ | ||
PIN_TIMEOUT("pin_timeout", ""); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个不要归类到该枚举里,枚举里是线程池层面常规项,这个加入不太合适 |
||
|
||
private final String value; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ | |
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
|
||
/** | ||
* ExecutorStats related | ||
|
@@ -74,7 +77,12 @@ public class ExecutorStats extends Metrics { | |
/** | ||
* 是否为虚拟线程执行器 | ||
*/ | ||
private boolean isVirtualExecutor; | ||
private boolean isVirtualThreadExecutor; | ||
|
||
/** | ||
* 拓展字段 | ||
*/ | ||
private final Map<String, Double> extMap = new ConcurrentHashMap<>(2); | ||
|
||
|
||
/** | ||
* 空闲时间 (ms) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ public static List<NotifyItem> mergeAllNotifyItems(List<NotifyItem> source) { | |
val defaultItems = getAllNotifyItems().stream() | ||
.filter(t -> !StringUtil.containsIgnoreCase(t.getType(), configuredTypes)) | ||
.collect(Collectors.toList()); | ||
List<NotifyItem> notifyItems = new ArrayList<>(6); | ||
List<NotifyItem> notifyItems = new ArrayList<>(7); | ||
notifyItems.addAll(defaultItems); | ||
notifyItems.addAll(source); | ||
return notifyItems; | ||
|
@@ -102,11 +102,16 @@ public static List<NotifyItem> getAllNotifyItems() { | |
queueTimeoutNotify.setType(NotifyItemEnum.QUEUE_TIMEOUT.getValue()); | ||
queueTimeoutNotify.setThreshold(10); | ||
|
||
List<NotifyItem> notifyItems = new ArrayList<>(6); | ||
NotifyItem pinTimeoutNotify = new NotifyItem(); | ||
pinTimeoutNotify.setType(NotifyItemEnum.PIN_TIMEOUT.getValue()); | ||
|
||
pinTimeoutNotify.setThreshold(10); | ||
|
||
List<NotifyItem> notifyItems = new ArrayList<>(7); | ||
notifyItems.addAll(getSimpleNotifyItems()); | ||
notifyItems.add(rejectNotify); | ||
notifyItems.add(runTimeoutNotify); | ||
notifyItems.add(queueTimeoutNotify); | ||
notifyItems.add(pinTimeoutNotify); | ||
|
||
return notifyItems; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是一个完整的json,不要拆分开,很难维护,格式容易配置错