diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-13 17:14:53 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-13 17:14:53 +0200 |
| commit | ce2d730159ae24c7cebb22ec42d094fe5fdc888f (patch) | |
| tree | 8a563eaaa0a933f9f5e93bca5d15b721c53dc168 /opendc-experiments/opendc-experiments-capelin | |
| parent | c4812123572c62483ee0183917fe2ff988e2968d (diff) | |
build: Update Kotlin dependencies
This change updates the Kotlin dependencies used by OpenDC to their
latest version.
Diffstat (limited to 'opendc-experiments/opendc-experiments-capelin')
2 files changed, 7 insertions, 4 deletions
diff --git a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt index 9548253d..42d240dc 100644 --- a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt +++ b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt @@ -186,7 +186,7 @@ suspend fun withMonitor( this, listOf(metricProducer), ExperimentMetricExporter(monitor, clock, scheduler.hosts.associateBy { it.uid.toString() }), - exportInterval = 5 * 60 * 1000 /* Every 5 min (which is the granularity of the workload trace) */ + exportInterval = 5L * 60 * 1000 /* Every 5 min (which is the granularity of the workload trace) */ ) try { diff --git a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/monitor/ExperimentMetricExporter.kt b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/monitor/ExperimentMetricExporter.kt index 54ab3b5b..f520a28c 100644 --- a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/monitor/ExperimentMetricExporter.kt +++ b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/monitor/ExperimentMetricExporter.kt @@ -22,6 +22,7 @@ package org.opendc.experiments.capelin.monitor +import io.opentelemetry.api.common.AttributeKey import io.opentelemetry.sdk.common.CompletableResultCode import io.opentelemetry.sdk.metrics.data.MetricData import io.opentelemetry.sdk.metrics.export.MetricExporter @@ -36,6 +37,8 @@ public class ExperimentMetricExporter( private val clock: Clock, private val hosts: Map<String, Host> ) : MetricExporter { + private val hostKey = AttributeKey.stringKey("host") + override fun export(metrics: Collection<MetricData>): CompletableResultCode { val metricsByName = metrics.associateBy { it.name } reportHostMetrics(metricsByName) @@ -99,7 +102,7 @@ public class ExperimentMetricExporter( private fun mapDoubleSummary(data: MetricData?, hostMetrics: MutableMap<String, HostMetrics>, block: (HostMetrics, Double) -> Unit) { val points = data?.doubleSummaryData?.points ?: emptyList() for (point in points) { - val uid = point.labels["host"] + val uid = point.attributes[hostKey] val hostMetric = hostMetrics[uid] if (hostMetric != null) { @@ -113,7 +116,7 @@ public class ExperimentMetricExporter( private fun mapDoubleGauge(data: MetricData?, hostMetrics: MutableMap<String, HostMetrics>, block: (HostMetrics, Double) -> Unit) { val points = data?.doubleGaugeData?.points ?: emptyList() for (point in points) { - val uid = point.labels["host"] + val uid = point.attributes[hostKey] val hostMetric = hostMetrics[uid] if (hostMetric != null) { @@ -125,7 +128,7 @@ public class ExperimentMetricExporter( private fun mapLongSum(data: MetricData?, hostMetrics: MutableMap<String, HostMetrics>, block: (HostMetrics, Long) -> Unit) { val points = data?.longSumData?.points ?: emptyList() for (point in points) { - val uid = point.labels["host"] + val uid = point.attributes[hostKey] val hostMetric = hostMetrics[uid] if (hostMetric != null) { |
