Skip to content


SQLMetricsReporting is an extension for OptimisticTransactionImpl to track performance metrics of Operations for reporting.


operationSQLMetrics Registry

operationSQLMetrics: Map[String, SQLMetric]

SQLMetricsReporting uses operationSQLMetrics internal registry for SQLMetrics (Spark SQL) by their names.

SQLMetrics are registered only when configuration property is enabled.

operationSQLMetrics is used when SQLMetricsReporting is requested for the following:

Registering SQLMetrics

  spark: SparkSession,
  metrics: Map[String, SQLMetric]): Unit

registerSQLMetrics adds (registers) the given metrics to the operationSQLMetrics internal registry only when configuration property is enabled.

registerSQLMetrics is used when:

Operation Metrics

  operation: Operation): Map[String, String]

getMetricsForOperation requests the given Operation to transform the operation metrics.

getMetricsForOperation is used when:

Looking Up Operation Metric

  name: String): Option[SQLMetric]

getMetric uses the operationSQLMetrics registry to look up the SQLMetric by name.

getMetric is used when: