aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSnapshot.scala
blob: 58e10c5492a2b1ffb52cbaf8235e3a4c490dc79d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package kamon.metric.instrument

import kamon.util.MeasurementUnit


case class SingleValueSnapshot(name: String, measurementUnit: MeasurementUnit, value: Long)

case class DistributionSnapshot(name: String, measurementUnit: MeasurementUnit, dynamicRange: DynamicRange, distribution: Distribution)

trait DistributionSnapshotInstrument {
  def snapshot(): DistributionSnapshot
}

trait SingleValueSnapshotInstrument {
  def snapshot(): SingleValueSnapshot
}




trait Distribution {
  def buckets: Seq[Bucket]
  def bucketsIterator: Iterator[Bucket]

  def min: Long
  def max: Long
  def sum: Long
  def count: Long
  def percentile(p: Double): Percentile

  def percentiles: Seq[Percentile]
  def percentilesIterator: Iterator[Percentile]
}

trait Bucket {
  def value: Long
  def frequency: Long
}

trait Percentile {
  def quantile: Double
  def value: Long
  def countUnderQuantile: Long
}