All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yammer.metrics.scala.Counter.scala Maven / Gradle / Ivy

The newest version!
package com.yammer.metrics.scala

/**
 * A Scala façade class for Counter.
 */
class Counter(metric: com.yammer.metrics.core.Counter) {

  /**
   * Increments the counter by delta.
   */
  def +=(delta: Long) {
    metric.inc(delta)
  }

  /**
   * Decrements the counter by delta.
   */
  def -=(delta: Long) {
    metric.dec(delta)
  }

  /**
   * Returns the current count.
   */
  def count = metric.count

  /**
   * Resets the counter to 0.
   */
  def clear() { metric.clear() }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy