File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
core/src/main/scala/org/apache/spark/util Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import scala.util.Try
2626
2727import org .apache .commons .io .output .TeeOutputStream
2828import org .apache .commons .lang3 .SystemUtils
29+ import org .apache .log4j .{Level , Logger }
2930
3031/**
3132 * Utility class to benchmark components. An example of how to use this is:
@@ -95,6 +96,17 @@ private[spark] class Benchmark(
9596 * provide some baseline.
9697 */
9798 def run (): Unit = {
99+ val logger = Logger .getRootLogger()
100+ val original = logger.getLevel()
101+ try {
102+ logger.setLevel(Level .toLevel(" INFO" )) // avoid DEBUG overheads
103+ run0()
104+ } finally {
105+ logger.setLevel(original)
106+ }
107+ }
108+
109+ private def run0 (): Unit = {
98110 require(benchmarks.nonEmpty)
99111 // scalastyle:off
100112 println(" Running benchmark: " + name)
You can’t perform that action at this time.
0 commit comments