Skip to content

Instantly share code, notes, and snippets.

@dimastatz
Last active May 6, 2021 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimastatz/d970347cd15f24ab13b9a3b94d66c6df to your computer and use it in GitHub Desktop.
Save dimastatz/d970347cd15f24ab13b9a3b94d66c6df to your computer and use it in GitHub Desktop.
package org.apache.spark.metrics.source
import com.codahale.metrics._
object LegionMetrics {
val metrics = new LegionMetrics
}
class LegionMetrics extends Source {
override val sourceName: String = "LegionCommonSource"
override val metricRegistry: MetricRegistry = new MetricRegistry
val runTime: Histogram = metricRegistry.histogram(MetricRegistry.name("legionCommonRuntime"))
val totalEvents: Counter = metricRegistry.counter(MetricRegistry.name("legionCommonTotalEventsCount"))
val totalErrors: Counter = metricRegistry.counter(MetricRegistry.name("legionCommonTotalErrorsCount"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment