diff --git a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxMetricsApi.scala b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxMetricsApi.scala index 49d45a396433..88aa8c90da73 100644 --- a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxMetricsApi.scala +++ b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxMetricsApi.scala @@ -338,7 +338,10 @@ class VeloxMetricsApi extends MetricsApi with Logging { def genWriteFilesTransformerMetrics(sparkContext: SparkContext): Map[String, SQLMetric] = Map( - "physicalWrittenBytes" -> SQLMetrics.createMetric(sparkContext, "number of written bytes"), + "physicalWrittenBytes" -> SQLMetrics.createSizeMetric( + sparkContext, + "number of written bytes"), + "wallNanos" -> SQLMetrics.createNanoTimingMetric(sparkContext, "time of write"), "numWrittenFiles" -> SQLMetrics.createMetric(sparkContext, "number of written files") ) diff --git a/gluten-data/src/main/scala/org/apache/gluten/metrics/WriteFilesMetricsUpdater.scala b/gluten-data/src/main/scala/org/apache/gluten/metrics/WriteFilesMetricsUpdater.scala index 5a04b404334f..30ed4aaa78cf 100644 --- a/gluten-data/src/main/scala/org/apache/gluten/metrics/WriteFilesMetricsUpdater.scala +++ b/gluten-data/src/main/scala/org/apache/gluten/metrics/WriteFilesMetricsUpdater.scala @@ -24,6 +24,7 @@ class WriteFilesMetricsUpdater(val metrics: Map[String, SQLMetric]) extends Metr if (opMetrics != null) { val operatorMetrics = opMetrics.asInstanceOf[OperatorMetrics] metrics("physicalWrittenBytes") += operatorMetrics.physicalWrittenBytes + metrics("wallNanos") += operatorMetrics.wallNanos metrics("numWrittenFiles") += operatorMetrics.numWrittenFiles } }