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

org.lyranthe.prometheus.client.histogram.Histogram.scala Maven / Gradle / Ivy

There is a newer version: 0.9.0-M5
Show newest version
package org.lyranthe.prometheus.client.histogram

import org.lyranthe.prometheus.client.internal.{
  UnsynchronizedDoubleAdder,
  UnsynchronizedLongAdder
}

private[client] object Histogram {
  def observe(adders: (UnsynchronizedDoubleAdder,
                       Array[(Double, UnsynchronizedLongAdder)]),
              v: Double): Unit = {
    var i: Int = 0
    while (i < adders._2.length) {
      val indexed = adders._2(i)
      if (v <= indexed._1)
        indexed._2.add(1)
      i = i + 1
    }

    adders._1.add(v)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy