HyukjinKwon commented on a change in pull request #23263: [SPARK-23674][ML] 
Adds Spark ML Events to Instrumentation
URL: https://github.com/apache/spark/pull/23263#discussion_r248660227
 
 

 ##########
 File path: mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala
 ##########
 @@ -197,10 +200,12 @@ object Pipeline extends MLReadable[Pipeline] {
   @Since("1.6.0")
   override def load(path: String): Pipeline = super.load(path)
 
-  private[Pipeline] class PipelineWriter(instance: Pipeline) extends MLWriter {
+  private[Pipeline] class PipelineWriter(val instance: Pipeline) extends 
MLWriter {
 
     SharedReadWrite.validateStages(instance.getStages)
 
+    override def save(path: String): Unit =
+      instrumented(_.withSaveInstanceEvent(this, path, logging = 
true)(super.save(path)))
 
 Review comment:
   Ah, I see. Maybe emitting debugging logs alone should be fine. Developers 
can do, for instance, 
   
   ```scala
   instrumented { inst => instr.withFitEvent(estimator, dataset) {
       instr.logDataset(dataset)
       ...
     }
   }
   ```
   
   ```scala
   instrumented { instr =>
     val output = instr.withTransformEvent(transformer, cur) {
       ...
     }
     instr.logError(...)
     instr.logDataset(output)
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to