mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-19 16:57:40 +03:00
Damlification of metrics prefix (#9665)
* Damlification of metrics prefix. CHANGELOG_BEGIN CHANGELOG_END * Fixed reference to metrics prefix. CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
3115d104aa
commit
7a54ca1926
@ -41,7 +41,7 @@ final class ExposedMetrics[T](
|
||||
}
|
||||
|
||||
object ExposedMetrics {
|
||||
private val Prefix: MetricName = MetricName.DAML :+ "bench_tool"
|
||||
private val Prefix: MetricName = MetricName.Daml :+ "bench_tool"
|
||||
|
||||
case class CounterMetric[T](counter: Counter, countingFunction: T => Long)
|
||||
case class BytesProcessedMetric[T](bytesProcessed: Counter, sizingFunction: T => Long)
|
||||
|
@ -15,7 +15,7 @@ final class MetricName(private val segments: Vector[String]) extends AnyVal {
|
||||
|
||||
object MetricName {
|
||||
|
||||
val DAML: MetricName = MetricName("daml")
|
||||
val Daml: MetricName = MetricName("daml")
|
||||
|
||||
def apply(segments: String*): MetricName =
|
||||
new MetricName(segments.toVector)
|
||||
|
@ -20,7 +20,7 @@ final class Metrics(val registry: MetricRegistry) {
|
||||
}
|
||||
|
||||
object daml {
|
||||
private val Prefix: MetricName = MetricName.DAML
|
||||
private val Prefix: MetricName = MetricName.Daml
|
||||
|
||||
object commands {
|
||||
private val Prefix: MetricName = daml.Prefix :+ "commands"
|
||||
|
@ -14,7 +14,7 @@ class PackageSpec extends AsyncWordSpec with Matchers {
|
||||
"succeed on multiple threads in parallel for the same metric name" in {
|
||||
val registry = new MetricRegistry
|
||||
implicit val executionContext: ExecutionContext = ExecutionContext.global
|
||||
val metricName = MetricName.DAML :+ "a" :+ "test"
|
||||
val metricName = MetricName.Daml :+ "a" :+ "test"
|
||||
val instances =
|
||||
(1 to 1000).map(_ => Future(registerGauge(metricName, () => () => 1.0, registry)))
|
||||
Future.sequence(instances).map { _ =>
|
||||
|
@ -32,6 +32,6 @@ package object kvutils {
|
||||
|
||||
type CorrelationId = String
|
||||
|
||||
val MetricPrefix: MetricName = MetricName.DAML :+ "kvutils"
|
||||
val MetricPrefix: MetricName = MetricName.Daml :+ "kvutils"
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user