c

ch.cern.sparkmeasure

TaskMetrics

case class TaskMetrics(sparkSession: SparkSession) extends Product with Serializable

Task Metrics: collects metrics data at Task granularity and provides aggregation and reporting functions for the end-user

Example of how to use task metrics: val taskMetrics = ch.cern.sparkmeasure.TaskMetrics(spark) taskMetrics.runAndMeasure(spark.sql("select count(*) from range(1000) cross join range(1000) cross join range(1000)").show)

The tool is based on using Spark Listeners as data source and collecting metrics in a ListBuffer of a case class that encapsulates Spark task metrics.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TaskMetrics
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TaskMetrics(sparkSession: SparkSession)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def aggregateTaskMetrics(nameTempView: String = "PerfTaskMetrics"): DataFrame
  5. def aggregateTaskMetrics(): LinkedHashMap[String, Long]
  6. def aggregateTaskMetricsJavaMap(): Map[String, Long]
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def begin(): Long
  9. var beginSnapshot: Long
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  11. def createTaskMetricsDF(nameTempView: String = "PerfTaskMetrics"): DataFrame
  12. def end(): Long
  13. var endSnapshot: Long
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. val listenerTask: TaskInfoRecorderListener
  18. lazy val logger: Logger
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  22. def printReport(): Unit
  23. def registerListener(spark: SparkSession, listener: TaskInfoRecorderListener): Unit
  24. def removeListener(): Unit
  25. def report(): String
  26. def reportUsingDataFrame(): String
  27. def runAndMeasure[T](f: ⇒ T): T
  28. def saveData(df: DataFrame, fileName: String, fileFormat: String = "json", saveMode: String = "default"): Unit
  29. def sendReportPrometheus(serverIPnPort: String, metricsJob: String, labelName: String = sparkSession.sparkContext.appName, labelValue: String = ...): Unit

    Send the metrics to Prometheus.

    Send the metrics to Prometheus. serverIPnPort: String with prometheus pushgateway address, format is hostIP:Port, metricsJob: job name, labelName: metrics label name, default is sparkSession.sparkContext.appName, labelValue: metrics label value, default is sparkSession.sparkContext.applicationId

  30. val sparkSession: SparkSession
  31. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped