diff --git a/src/main/scala/com/databricks/spark/sql/perf/mllib/MLPipelineStageBenchmarkable.scala b/src/main/scala/com/databricks/spark/sql/perf/mllib/MLPipelineStageBenchmarkable.scala index 25ddd42..edb272d 100644 --- a/src/main/scala/com/databricks/spark/sql/perf/mllib/MLPipelineStageBenchmarkable.scala +++ b/src/main/scala/com/databricks/spark/sql/perf/mllib/MLPipelineStageBenchmarkable.scala @@ -95,13 +95,16 @@ class MLPipelineStageBenchmarkable( } val mlMetrics = Array(metricTrainingTime, metricTraining, metricTestTime, metricTest) + val paramsMap = params.toMap + val benchmarkId = name.split('.').last + "_" + paramsMap.hashCode.abs BenchmarkResult( name = name, mode = executionMode.toString, - parameters = params.toMap, + parameters = paramsMap, executionTime = Some(trainingTime.toMillis), - mlResult = Some(mlMetrics)) + mlResult = Some(mlMetrics), + benchmarkId = Some(benchmarkId)) } catch { case e: Exception => BenchmarkResult( diff --git a/src/main/scala/com/databricks/spark/sql/perf/results.scala b/src/main/scala/com/databricks/spark/sql/perf/results.scala index 87f0a28..28d7226 100644 --- a/src/main/scala/com/databricks/spark/sql/perf/results.scala +++ b/src/main/scala/com/databricks/spark/sql/perf/results.scala @@ -67,6 +67,12 @@ case class BenchmarkConfiguration( * For example, it can be the number of rows generated by this query or * the sum of hash values of rows generated by this query. * @param breakDown The breakdown results of the query plan tree. + * @param queryExecution The query execution plan. + * @param failure The failure message. + * @param mlResult The result metrics specific to MLlib. + * @param benchmarkId An optional ID to identify a series of benchmark runs. + * In ML, this is generated based on the benchmark name and + * the hash value of params. */ case class BenchmarkResult( name: String, @@ -83,7 +89,8 @@ case class BenchmarkResult( breakDown: Seq[BreakdownResult] = Nil, queryExecution: Option[String] = None, failure: Option[Failure] = None, - mlResult: Option[Array[MLMetric]] = None) + mlResult: Option[Array[MLMetric]] = None, + benchmarkId: Option[String] = None) /** * The execution time of a subtree of the query plan tree of a specific query. @@ -240,4 +247,4 @@ case class MLMetric( object MLMetric { val Invalid = MLMetric("Invalid", 0.0, false) -} +} \ No newline at end of file