spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From van...@apache.org
Subject spark git commit: [SPARK-13238][CORE] Add ganglia dmax parameter
Date Fri, 05 Aug 2016 20:07:57 GMT
Repository: spark
Updated Branches:
  refs/heads/master 180fd3e0a -> 1f96c97f2


[SPARK-13238][CORE] Add ganglia dmax parameter

The current ganglia reporter doesn't set metric expiration time (dmax). The metrics of all
finished applications are indefinitely left displayed in ganglia web. The dmax parameter allows
user to set the lifetime of the metrics. The default value is 0 for compatibility with previous
versions.

Author: Ekasit Kijsipongse <ekasitk@gmail.com>

Closes #11127 from ekasitk/ganglia-dmax.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1f96c97f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1f96c97f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1f96c97f

Branch: refs/heads/master
Commit: 1f96c97f2374a95140a0c72b1f4eae50ac21d84a
Parents: 180fd3e
Author: Ekasit Kijsipongse <ekasitk@gmail.com>
Authored: Fri Aug 5 13:07:52 2016 -0700
Committer: Marcelo Vanzin <vanzin@cloudera.com>
Committed: Fri Aug 5 13:07:52 2016 -0700

----------------------------------------------------------------------
 conf/metrics.properties.template                                | 1 +
 .../main/scala/org/apache/spark/metrics/sink/GangliaSink.scala  | 5 +++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/1f96c97f/conf/metrics.properties.template
----------------------------------------------------------------------
diff --git a/conf/metrics.properties.template b/conf/metrics.properties.template
index 8a4f4e4..aeb76c9 100644
--- a/conf/metrics.properties.template
+++ b/conf/metrics.properties.template
@@ -93,6 +93,7 @@
 #   period    10         Poll period
 #   unit      seconds    Unit of the poll period
 #   ttl       1          TTL of messages sent by Ganglia
+#   dmax      0          Lifetime in seconds of metrics (0 never expired)
 #   mode      multicast  Ganglia network mode ('unicast' or 'multicast')
 
 # org.apache.spark.metrics.sink.JmxSink

http://git-wip-us.apache.org/repos/asf/spark/blob/1f96c97f/external/spark-ganglia-lgpl/src/main/scala/org/apache/spark/metrics/sink/GangliaSink.scala
----------------------------------------------------------------------
diff --git a/external/spark-ganglia-lgpl/src/main/scala/org/apache/spark/metrics/sink/GangliaSink.scala
b/external/spark-ganglia-lgpl/src/main/scala/org/apache/spark/metrics/sink/GangliaSink.scala
index 3b1880e..0cd795f 100644
--- a/external/spark-ganglia-lgpl/src/main/scala/org/apache/spark/metrics/sink/GangliaSink.scala
+++ b/external/spark-ganglia-lgpl/src/main/scala/org/apache/spark/metrics/sink/GangliaSink.scala
@@ -46,6 +46,9 @@ class GangliaSink(val property: Properties, val registry: MetricRegistry,
   val GANGLIA_KEY_HOST = "host"
   val GANGLIA_KEY_PORT = "port"
 
+  val GANGLIA_KEY_DMAX = "dmax"
+  val GANGLIA_DEFAULT_DMAX = 0
+
   def propertyToOption(prop: String): Option[String] = Option(property.getProperty(prop))
 
   if (!propertyToOption(GANGLIA_KEY_HOST).isDefined) {
@@ -59,6 +62,7 @@ class GangliaSink(val property: Properties, val registry: MetricRegistry,
   val host = propertyToOption(GANGLIA_KEY_HOST).get
   val port = propertyToOption(GANGLIA_KEY_PORT).get.toInt
   val ttl = propertyToOption(GANGLIA_KEY_TTL).map(_.toInt).getOrElse(GANGLIA_DEFAULT_TTL)
+  val dmax = propertyToOption(GANGLIA_KEY_DMAX).map(_.toInt).getOrElse(GANGLIA_DEFAULT_DMAX)
   val mode: UDPAddressingMode = propertyToOption(GANGLIA_KEY_MODE)
     .map(u => GMetric.UDPAddressingMode.valueOf(u.toUpperCase)).getOrElse(GANGLIA_DEFAULT_MODE)
   val pollPeriod = propertyToOption(GANGLIA_KEY_PERIOD).map(_.toInt)
@@ -73,6 +77,7 @@ class GangliaSink(val property: Properties, val registry: MetricRegistry,
   val reporter: GangliaReporter = GangliaReporter.forRegistry(registry)
       .convertDurationsTo(TimeUnit.MILLISECONDS)
       .convertRatesTo(TimeUnit.SECONDS)
+      .withDMax(dmax)
       .build(ganglia)
 
   override def start() {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message