Represents a timer, for timing a function. Call the time function, passing the function to time.
For recording metrics the Timer either uses the passed-in MetricsRecorder if it is defined, or it looks in
the Metrics.Recorder field for a recorder. If neither of these are defined then no metrics are recorded
(the function is executed without recording metrics).
The overhead of recording metrics has been measured at around 100 nanoseconds on an Intel i7-3720QM. The overhead
of calling the time method when no metrics are being recorded (a recorder is not defined) is negligible.
Note
This class needs to be in the org.apache.spark.rdd package, otherwise Spark records somewhere in the
time method as the call site (which in turn becomes the stage name).
This can be fixed when Spark 1.1.1 is released (needs SPARK-1853).
Represents a timer, for timing a function. Call the
time
function, passing the function to time.For recording metrics the Timer either uses the passed-in MetricsRecorder if it is defined, or it looks in the Metrics.Recorder field for a recorder. If neither of these are defined then no metrics are recorded (the function is executed without recording metrics).
The overhead of recording metrics has been measured at around 100 nanoseconds on an Intel i7-3720QM. The overhead of calling the
time
method when no metrics are being recorded (a recorder is not defined) is negligible.This class needs to be in the org.apache.spark.rdd package, otherwise Spark records somewhere in the
time
method as the call site (which in turn becomes the stage name). This can be fixed when Spark 1.1.1 is released (needs SPARK-1853).