I use Spark 2.4.
I'm migrating a Spark Streaming application to Structured Streaming.
I am working on generation metrics for each batch and I want to have control over the stats for each micro batch. I am interested in processingDelay, schedulingDelay and totalDelay metrics of each microBatch and where to find them in Structured Streaming.
I tried the following approach but it doesn't generate any stats.
val recentBatchInfos = new StatsReportListener(60).batchInfos
val numberOfRecords = recentBatchInfos.map(_.numRecords).sum
Can anyone tell how to use have control over stats and generate the corresponding metrics?