I need to measure the execution time of query on Apache spark (Bluemix). What I tried:
import time startTimeQuery = time.clock() df = sqlContext.sql(query)
I use System.nanoTime wrapped around a helper function, like this -
System.nanoTime
def time[A](f: => A) = { val s = System.nanoTime val ret = f println("time: "+(System.nanoTime-s)/1e6+"ms") ret } time { df = sqlContext.sql(query) df.show() }