Skip to content

Commit

Permalink
[CELEBORN-1182][FOLLOWUP] Fix WorkerSource record application active …
Browse files Browse the repository at this point in the history
…connection for application dimension ActiveConnectionCount metric

### What changes were proposed in this pull request?

Fix `WorkerSource` record application active connection for application dimension `ActiveConnectionCount` metric.

Follow up #2167.

### Why are the changes needed?

Application dimension `ActiveConnectionCount` metric does not have value because the check of recording application active connection is wrong for `WorkerSource`.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

GA.

```
celebornceleborn-worker-1:/data/service/celeborn$ curl http://celeborn-worker-1:9096/metrics|grep application|grep ActiveConnectionCount
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 53673    0 53673    0     0  2710k      0 --:--:-- --:--:-- --:--:-- 2758k
metrics_ActiveConnectionCount_Value{applicationId="application_1692685933461_14488489",hostName="celeborn-worker-1",role="Worker"} 68 1717418613619
metrics_ActiveConnectionCount_Value{applicationId="application_1692685933461_14488489",hostName="celeborn-worker-1",role="Worker"} 68 1717418613619
```

Closes #2542 from SteNicholas/CELEBORN-1182.

Authored-by: SteNicholas <[email protected]>
Signed-off-by: mingji <[email protected]>
(cherry picked from commit aa8ff3c)
Signed-off-by: mingji <[email protected]>
  • Loading branch information
SteNicholas authored and FMX committed Jun 4, 2024
1 parent 1a9205b commit 94801b6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class WorkerSource(conf: CelebornConf) extends AbstractSource(conf, MetricsSyste
def recordAppActiveConnection(client: TransportClient, shuffleKey: String): Unit = {
val applicationIds = appActiveConnections.get(client.getChannel.id().asLongText())
val applicationId = Utils.splitShuffleKey(shuffleKey)._1
if (CollectionUtils.isNotEmpty(applicationIds) && !applicationIds.contains(applicationId)) {
if (applicationIds != null && !applicationIds.contains(applicationId)) {
applicationIds.add(applicationId)
addGauge(ACTIVE_CONNECTION_COUNT, Map(applicationLabel -> applicationId)) { () =>
appActiveConnections.asScala.count { case (_, applicationIds) =>
Expand Down

0 comments on commit 94801b6

Please sign in to comment.