SteNicholas commented on code in PR #2059:
URL:
https://github.com/apache/incubator-celeborn/pull/2059#discussion_r1377425756
##########
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:
@AngersZhuuuu, due to invoke `addGauge[T](name: String, labels: Map[String,
String] = Map.empty)(f: () => T)`, the metrics would be registered for new
userIdentifier.
--
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]