diff options
author | Eric Liang <ekl@databricks.com> | 2016-06-29 15:07:32 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-06-29 15:07:32 -0700 |
commit | 23c58653f900bfb71ef2b3186a95ad2562c33969 (patch) | |
tree | cb33af47a0654ffa60f22f727951c48b6777e98b /core | |
parent | 9b1b3ae771babf127f64898d5dc110721597a760 (diff) | |
download | spark-23c58653f900bfb71ef2b3186a95ad2562c33969.tar.gz spark-23c58653f900bfb71ef2b3186a95ad2562c33969.tar.bz2 spark-23c58653f900bfb71ef2b3186a95ad2562c33969.zip |
[SPARK-16238] Metrics for generated method and class bytecode size
## What changes were proposed in this pull request?
This extends SPARK-15860 to include metrics for the actual bytecode size of janino-generated methods. They can be accessed in the same way as any other codahale metric, e.g.
```
scala> org.apache.spark.metrics.source.CodegenMetrics.METRIC_GENERATED_CLASS_BYTECODE_SIZE.getSnapshot().getValues()
res7: Array[Long] = Array(532, 532, 532, 542, 1479, 2670, 3585, 3585)
scala> org.apache.spark.metrics.source.CodegenMetrics.METRIC_GENERATED_METHOD_BYTECODE_SIZE.getSnapshot().getValues()
res8: Array[Long] = Array(5, 5, 5, 5, 10, 10, 10, 10, 15, 15, 15, 38, 63, 79, 88, 94, 94, 94, 132, 132, 165, 165, 220, 220)
```
## How was this patch tested?
Small unit test, also verified manually that the performance impact is minimal (<10%). hvanhovell
Author: Eric Liang <ekl@databricks.com>
Closes #13934 from ericl/spark-16238.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/metrics/source/StaticSources.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/metrics/source/StaticSources.scala b/core/src/main/scala/org/apache/spark/metrics/source/StaticSources.scala index 6819222e15..6bba259acc 100644 --- a/core/src/main/scala/org/apache/spark/metrics/source/StaticSources.scala +++ b/core/src/main/scala/org/apache/spark/metrics/source/StaticSources.scala @@ -47,4 +47,16 @@ object CodegenMetrics extends Source { * Histogram of the time it took to compile source code text (in milliseconds). */ val METRIC_COMPILATION_TIME = metricRegistry.histogram(MetricRegistry.name("compilationTime")) + + /** + * Histogram of the bytecode size of each class generated by CodeGenerator. + */ + val METRIC_GENERATED_CLASS_BYTECODE_SIZE = + metricRegistry.histogram(MetricRegistry.name("generatedClassSize")) + + /** + * Histogram of the bytecode size of each method in classes generated by CodeGenerator. + */ + val METRIC_GENERATED_METHOD_BYTECODE_SIZE = + metricRegistry.histogram(MetricRegistry.name("generatedMethodSize")) } |