AngersZhuuuu commented on code in PR #2059:
URL:
https://github.com/apache/incubator-celeborn/pull/2059#discussion_r1377373087
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala:
##########
@@ -509,6 +513,50 @@ private[celeborn] class Worker(
// If worker register still failed after retry, throw exception to stop
worker process
throw new CelebornException("Register worker failed.", exception)
}
+
+ private def handleResourceConsumption(): util.Map[UserIdentifier,
ResourceConsumption] = {
+ val resourceConsumptionSnapshot =
storageManager.userResourceConsumptionSnapshot()
+ resourceConsumptionSnapshot.foreach(resourceConsumption => {
Review Comment:
```
resourceConsumptionSnapshot.foreach { resourceConsumption =>
......
}
```
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala:
##########
@@ -509,6 +513,50 @@ private[celeborn] class Worker(
// If worker register still failed after retry, throw exception to stop
worker process
throw new CelebornException("Register worker failed.", exception)
}
+
+ private def handleResourceConsumption(): util.Map[UserIdentifier,
ResourceConsumption] = {
+ val resourceConsumptionSnapshot =
storageManager.userResourceConsumptionSnapshot()
+ resourceConsumptionSnapshot.foreach(resourceConsumption => {
+ resourceConsumptionSource.addGauge(
+ ResourceConsumptionSource.DISK_FILE_COUNT,
+ resourceConsumption._1.toMap) { () =>
+ computeUserResourceConsumption(resourceConsumption).diskFileCount
+ }
+ resourceConsumptionSource.addGauge(
+ ResourceConsumptionSource.DISK_BYTES_WRITTEN,
+ resourceConsumption._1.toMap) { () =>
+ computeUserResourceConsumption(resourceConsumption).diskBytesWritten
+ }
Review Comment:
Seems we should not register metrics here?
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/WorkerSource.scala:
##########
@@ -18,13 +18,15 @@
package org.apache.celeborn.service.deploy.worker
import org.apache.celeborn.common.CelebornConf
+import org.apache.celeborn.common.internal.Logging
import org.apache.celeborn.common.metrics.MetricsSystem
import org.apache.celeborn.common.metrics.source.AbstractSource
+import org.apache.celeborn.service.deploy.worker.WorkerSource._
-class WorkerSource(conf: CelebornConf) extends AbstractSource(conf,
MetricsSystem.ROLE_WORKER) {
+class WorkerSource(conf: CelebornConf) extends AbstractSource(conf,
MetricsSystem.ROLE_WORKER)
+ with Logging {
Review Comment:
Why with Logging? Should remove?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]