aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
authorEric Liang <ekl@databricks.com>2016-06-11 23:16:21 -0700
committerReynold Xin <rxin@databricks.com>2016-06-11 23:16:21 -0700
commite1f986c7a3fcc3864d53ef99ef7f14fa4d262ac3 (patch)
treef1295516a2696cfe16f8706e57ee4cb75169e22c /core/src/test
parent3fd2ff4dd85633af49865456a52bf0c09c99708b (diff)
downloadspark-e1f986c7a3fcc3864d53ef99ef7f14fa4d262ac3.tar.gz
spark-e1f986c7a3fcc3864d53ef99ef7f14fa4d262ac3.tar.bz2
spark-e1f986c7a3fcc3864d53ef99ef7f14fa4d262ac3.zip
[SPARK-15860] Metrics for codegen size and perf
## What changes were proposed in this pull request? Adds codahale metrics for the codegen source text size and how long it takes to compile. The size is particularly interesting, since the JVM does have hard limits on how large methods can get. To simplify, I added the metrics under a statically-initialized source that is always registered with SparkEnv. ## How was this patch tested? Unit tests Author: Eric Liang <ekl@databricks.com> Closes #13586 from ericl/spark-15860.
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala b/core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala
index 5d8554229d..2400832f6e 100644
--- a/core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala
+++ b/core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala
@@ -24,7 +24,7 @@ import org.scalatest.{BeforeAndAfter, PrivateMethodTester}
import org.apache.spark.{SecurityManager, SparkConf, SparkFunSuite}
import org.apache.spark.deploy.master.MasterSource
-import org.apache.spark.metrics.source.Source
+import org.apache.spark.metrics.source.{Source, StaticSources}
class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateMethodTester{
var filePath: String = _
@@ -43,7 +43,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM
val sources = PrivateMethod[ArrayBuffer[Source]]('sources)
val sinks = PrivateMethod[ArrayBuffer[Source]]('sinks)
- assert(metricsSystem.invokePrivate(sources()).length === 0)
+ assert(metricsSystem.invokePrivate(sources()).length === StaticSources.allSources.length)
assert(metricsSystem.invokePrivate(sinks()).length === 0)
assert(metricsSystem.getServletHandlers.nonEmpty)
}
@@ -54,13 +54,13 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM
val sources = PrivateMethod[ArrayBuffer[Source]]('sources)
val sinks = PrivateMethod[ArrayBuffer[Source]]('sinks)
- assert(metricsSystem.invokePrivate(sources()).length === 0)
+ assert(metricsSystem.invokePrivate(sources()).length === StaticSources.allSources.length)
assert(metricsSystem.invokePrivate(sinks()).length === 1)
assert(metricsSystem.getServletHandlers.nonEmpty)
val source = new MasterSource(null)
metricsSystem.registerSource(source)
- assert(metricsSystem.invokePrivate(sources()).length === 1)
+ assert(metricsSystem.invokePrivate(sources()).length === StaticSources.allSources.length + 1)
}
test("MetricsSystem with Driver instance") {