Skip to content
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

[#1686] feat(netty): Support pending tasks number metrics for Netty EventLoopGroup #1687

Merged
merged 5 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ public abstract class NettyMetrics extends RPCMetrics {

private static final String NETTY_ACTIVE_CONNECTION = "netty_active_connection";
private static final String NETTY_HANDLE_EXCEPTION = "netty_handle_exception";
private static final String NETTY_PENDING_TASKS_NUM_FOR_BOSS_GROUP =
"netty_pending_tasks_num_for_boss_group";
private static final String NETTY_PENDING_TASKS_NUM_FOR_WORKER_GROUP =
"netty_pending_tasks_num_for_worker_group";

protected Gauge.Child gaugeNettyActiveConn;
protected Counter.Child counterNettyException;
protected Gauge.Child gaugeNettyPendingTasksNumForBossGroup;
protected Gauge.Child gaugeNettyPendingTasksNumForWorkerGroup;

public NettyMetrics(RssConf rssConf, String tags) {
super(rssConf, tags);
Expand All @@ -38,6 +44,10 @@ public NettyMetrics(RssConf rssConf, String tags) {
public void registerGeneralMetrics() {
gaugeNettyActiveConn = metricsManager.addLabeledGauge(NETTY_ACTIVE_CONNECTION);
counterNettyException = metricsManager.addLabeledCounter(NETTY_HANDLE_EXCEPTION);
gaugeNettyPendingTasksNumForBossGroup =
metricsManager.addLabeledGauge(NETTY_PENDING_TASKS_NUM_FOR_BOSS_GROUP);
gaugeNettyPendingTasksNumForWorkerGroup =
metricsManager.addLabeledGauge(NETTY_PENDING_TASKS_NUM_FOR_WORKER_GROUP);
}

public Counter.Child getCounterNettyException() {
Expand All @@ -47,4 +57,12 @@ public Counter.Child getCounterNettyException() {
public Gauge.Child getGaugeNettyActiveConn() {
return gaugeNettyActiveConn;
}

public Gauge.Child getGaugeNettyPendingTasksNumForBossGroup() {
return gaugeNettyPendingTasksNumForBossGroup;
}

public Gauge.Child getGaugeNettyPendingTasksNumForWorkerGroup() {
return gaugeNettyPendingTasksNumForWorkerGroup;
}
}
Loading
Loading