You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "SteNicholas (via GitHub)" <gi...@apache.org> on 2023/12/15 08:23:47 UTC

[PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

SteNicholas opened a new pull request, #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161

   ### What changes were proposed in this pull request?
   
   Introduce application dimension resource consumption metrics for `ResourceConsumptionSource`.
   
   ### Why are the changes needed?
   
   `ResourceConsumption` namespace metrics are generated for each user and they are identified using a metric tag at present. It's recommended to introduce application dimension resource consumption metrics that expose application dimension resource consumption of Master and Worker. By monitoring resource consumption in the application dimension, you can obtain the actual situation of application resource consumption. 
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   - `WorkerInfoSuite#WorkerInfo equals when appResourceConsumption different`
   - `PbSerDeUtilsTest#fromAndToPbAppResourceConsumption`
   - `MasterStateMachineSuiteJ`
   - `RatisMasterStatusSystemSuiteJ`
   - `DefaultMetaSystemSuiteJ`
   - `SlotsAllocatorRackAwareSuiteJ`
   - `SlotsAllocatorSuiteJ`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas closed pull request #2161: [CELEBORN-1174] Introduce application dimension resource consumption metrics
URL: https://github.com/apache/incubator-celeborn/pull/2161


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#issuecomment-1873808961

   @FMX, I have addressed above comments and updated `celeborn-dashboard.json` for application dimension resource consumption metrics.  PTAL.
   @onebox-li, could you help to review whether the dashboard of `celeborn-dashboard.json` is correct?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#discussion_r1442477789


##########
common/src/main/scala/org/apache/celeborn/common/identity/ApplicationIdentifier.scala:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.celeborn.common.identity
+
+import org.apache.celeborn.common.exception.CelebornException
+import org.apache.celeborn.common.internal.Logging
+
+case class ApplicationIdentifier(tenantId: String, name: String, applicationId: String) {

Review Comment:
   > Does this modification match your expectations? @RexXiong
   
   As we already have UserResourceConsumption,ApplicationIdentifier for APPResourceConsumption seems redundant,I think what we actually need is a nested structure, like map<string, map<string, ResourceConsumption>>, thanks.



##########
common/src/main/proto/TransportMessages.proto:
##########
@@ -162,8 +163,9 @@ message PbRegisterWorker {
   int32 fetchPort = 4;
   int32 replicatePort = 5;
   repeated PbDiskInfo disks = 6;
-  string requestId = 9;
   map<string, PbResourceConsumption> userResourceConsumption = 8;
+  string requestId = 9;
+  map<string, PbResourceConsumption> applicationResourceConsumption = 10;

Review Comment:
   IMO the key of applicationResourceConsumption does not look so intuitive,
   At first look,  I thought this must be the applicationId.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas closed pull request #2161: [CELEBORN-1174] Introduce application dimension resource consumption metrics
URL: https://github.com/apache/incubator-celeborn/pull/2161


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#issuecomment-1898433950

   @RexXiong, @FMX, I have followed your suggestion which uses `subResourceConsumption` to store resource consumpution of  application. PTAL.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#discussion_r1465084931


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala:
##########
@@ -596,6 +625,38 @@ private[celeborn] class Worker(
       })
     }
 
+  private def removeAppResourceConsumption(applicationId: String): Unit = {
+    userResourceConsumptions.asScala.foreach {

Review Comment:
   userResourceConsumptions may not contain the application info ,then The gauge of the application in ResourceConsumptionSource can't be removed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#issuecomment-1874915856

   @RexXiong, I have supported that resource consumption of application be categorized by tenant-sub-user via `ApplicationIdentifier` which includes the tenantId and name of the user identifier. PTAL.
   @FMX, I have improved duplicated codes snippets and addressed above comment. PTAL.
   @onebox-li, could you help to review the celeborn dashboard?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#discussion_r1461297495


##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -851,55 +851,74 @@ private[celeborn] class Master(
     statusSystem.handleRemoveWorkersUnavailableInfo(unavailableWorkers, requestId)
   }
 
-  private def computeUserResourceConsumption(userIdentifier: UserIdentifier)
-      : ResourceConsumption = {
-    val current = System.currentTimeMillis()
-    if (userResourceConsumptions.containsKey(userIdentifier)) {
-      val resourceConsumptionAndUpdateTime = userResourceConsumptions.get(userIdentifier)
-      if (current - resourceConsumptionAndUpdateTime._2 > masterResourceConsumptionInterval) {
-        val newResourceConsumption = statusSystem.workers.asScala.flatMap { workerInfo =>
-          workerInfo.userResourceConsumption.asScala.get(userIdentifier)
-        }.foldRight(ResourceConsumption(0, 0, 0, 0))(_ add _)
-        userResourceConsumptions.put(userIdentifier, (newResourceConsumption, current))
-        newResourceConsumption
-      } else {
-        resourceConsumptionAndUpdateTime._1
-      }
-    } else {
-      val newResourceConsumption = statusSystem.workers.asScala.flatMap { workerInfo =>
-        workerInfo.userResourceConsumption.asScala.get(userIdentifier)
-      }.foldRight(ResourceConsumption(0, 0, 0, 0))(_ add _)
-      userResourceConsumptions.put(userIdentifier, (newResourceConsumption, current))
-      newResourceConsumption
+  private def handleResourceConsumption(userIdentifier: UserIdentifier): ResourceConsumption = {
+    val userResourceConsumption = computeUserResourceConsumption(userIdentifier)
+    gaugeResourceConsumption(userIdentifier)
+    val subResourceConsumptions = userResourceConsumption.subResourceConsumptions
+    if (CollectionUtils.isNotEmpty(subResourceConsumptions)) {
+      subResourceConsumptions.asScala.keys.foreach { gaugeResourceConsumption(userIdentifier, _) }
     }
+    userResourceConsumption
   }
 
-  private def handleCheckQuota(
+  private def gaugeResourceConsumption(
       userIdentifier: UserIdentifier,
-      context: RpcCallContext): Unit = {
-
+      applicationId: String = null): Unit = {
+    val resourceConsumptionLabel =
+      if (applicationId == null) userIdentifier.toMap

Review Comment:
   IMO we should clean these metrics regularly, such as when the application timeout?



##########
common/src/main/scala/org/apache/celeborn/common/quota/ResourceConsumption.scala:
##########
@@ -17,26 +17,67 @@
 
 package org.apache.celeborn.common.quota
 
-import org.apache.celeborn.common.util.Utils
+import java.util
+
+import scala.collection.JavaConverters._
+
+import org.apache.celeborn.common.util.{CollectionUtils, Utils}
 
 case class ResourceConsumption(
     diskBytesWritten: Long,
     diskFileCount: Long,
     hdfsBytesWritten: Long,
-    hdfsFileCount: Long) {
+    hdfsFileCount: Long,
+    subResourceConsumptions: util.Map[String, ResourceConsumption] = null) {
 
   def add(other: ResourceConsumption): ResourceConsumption = {
     ResourceConsumption(
       diskBytesWritten + other.diskBytesWritten,
       diskFileCount + other.diskFileCount,
       hdfsBytesWritten + other.hdfsBytesWritten,
-      hdfsFileCount + other.hdfsFileCount)
+      hdfsFileCount + other.hdfsFileCount,
+      subResourceConsumptions(other))
+  }
+
+  private def subResourceConsumptions(other: ResourceConsumption)
+      : util.Map[String, ResourceConsumption] = {
+    var resourceConsumptions: util.Map[String, ResourceConsumption] = null
+    if (subResourceConsumptions == null) {
+      resourceConsumptions = other.subResourceConsumptions
+    } else {
+      resourceConsumptions = subResourceConsumptions

Review Comment:
   If use subResourceConsumptions directly, IMO it may lead to repeated resource consumption calculations. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#issuecomment-1916393603

   @RexXiong, I have addressed comments mentioned above and rebased main branch to update the resource consumption gauge of worker. PTAL.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#issuecomment-1857488446

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: `43 lines` in your changes are missing coverage. Please review.
   > Comparison is base [(`b4bbe4b`)](https://app.codecov.io/gh/apache/incubator-celeborn/commit/b4bbe4b15182882b4172b239bc22afba7babe9b4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 46.15% compared to head [(`919b39c`)](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 46.04%.
   > Report is 1 commits behind head on main.
   
   | [Files](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...born/common/protocol/message/ControlMessages.scala](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL3Byb3RvY29sL21lc3NhZ2UvQ29udHJvbE1lc3NhZ2VzLnNjYWxh) | 0.00% | [19 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...org/apache/celeborn/common/util/PbSerDeUtils.scala](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL3V0aWwvUGJTZXJEZVV0aWxzLnNjYWxh) | 47.06% | [8 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...a/org/apache/celeborn/common/meta/WorkerInfo.scala](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL21ldGEvV29ya2VySW5mby5zY2FsYQ==) | 70.00% | [5 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...cala/org/apache/celeborn/common/CelebornConf.scala](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL0NlbGVib3JuQ29uZi5zY2FsYQ==) | 80.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...eleborn/common/metrics/source/AbstractSource.scala](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL21ldHJpY3Mvc291cmNlL0Fic3RyYWN0U291cmNlLnNjYWxh) | 40.00% | [2 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...mon/metrics/source/ResourceConsumptionSource.scala](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL21ldHJpY3Mvc291cmNlL1Jlc291cmNlQ29uc3VtcHRpb25Tb3VyY2Uuc2NhbGE=) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main    #2161      +/-   ##
   ==========================================
   - Coverage   46.15%   46.04%   -0.10%     
   ==========================================
     Files         180      180              
     Lines       11492    11547      +55     
     Branches     1027     1034       +7     
   ==========================================
   + Hits         5303     5316      +13     
   - Misses       5840     5876      +36     
   - Partials      349      355       +6     
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/incubator-celeborn/pull/2161?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "FMX (via GitHub)" <gi...@apache.org>.
FMX commented on code in PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#discussion_r1440162740


##########
common/src/main/scala/org/apache/celeborn/common/identity/ApplicationIdentifier.scala:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.celeborn.common.identity
+
+import org.apache.celeborn.common.exception.CelebornException
+import org.apache.celeborn.common.internal.Logging
+
+case class ApplicationIdentifier(tenantId: String, name: String, applicationId: String) {

Review Comment:
   Does this modification match your expectations? @RexXiong 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#issuecomment-1865509989

   Since Celeborn supports multi-tenancy, I suggest that the app's resource consumption should also be categorized by tenant-sub-user.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#issuecomment-1905393169

   @RexXiong, I have addressed above comment and added the cleaner of application resource consumption gauges. PTAL.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#issuecomment-1920668804

   Merged into main(v0.5.0).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-1174] Introduce application dimension resource consumption metrics [incubator-celeborn]

Posted by "FMX (via GitHub)" <gi...@apache.org>.
FMX commented on code in PR #2161:
URL: https://github.com/apache/incubator-celeborn/pull/2161#discussion_r1436800732


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -839,6 +839,38 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs
     }
   }
 
+  def appResourceConsumptionSnapshot(): Map[String, ResourceConsumption] = {

Review Comment:
   This method is similar to userResourceConsumptionSnapshot.



##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala:
##########
@@ -565,14 +614,30 @@ private[celeborn] class Worker(
     val current = System.currentTimeMillis()
     if (userResourceConsumptions.containsKey(userIdentifier)) {
       val resourceConsumptionAndUpdateTime = userResourceConsumptions.get(userIdentifier)
-      if (current - resourceConsumptionAndUpdateTime._2 <= workerResourceConsumptionInterval) {
+      if (current - resourceConsumptionAndUpdateTime._2 <= workerUserResourceConsumptionInterval) {
         return resourceConsumptionAndUpdateTime._1
       }
     }
     userResourceConsumptions.put(userIdentifier, (resourceConsumption, current))
     resourceConsumption
   }
 
+  private def computeAppResourceConsumption(appResourceConsumption: (

Review Comment:
   IMO, these method looks quite similar. I think they can be merged.



##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala:
##########
@@ -528,35 +546,66 @@ private[celeborn] class Worker(
     throw new CelebornException("Register worker failed.", exception)
   }
 
-  private def handleResourceConsumption(): util.Map[UserIdentifier, ResourceConsumption] = {
+  private def handleUserResourceConsumption(): util.Map[UserIdentifier, ResourceConsumption] = {

Review Comment:
   This method handleUserResourceConsumption is similar to handleAppResourceConsumption. They can be merged.



##########
common/src/main/scala/org/apache/celeborn/common/meta/WorkerInfo.scala:
##########
@@ -188,6 +194,14 @@ class WorkerInfo(
     userResourceConsumption
   }
 
+  def updateThenGetAppResourceConsumption(consumption: util.Map[

Review Comment:
   I think we can reduce duplicate codes snippets.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org