diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-03-27 12:33:13 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-03-27 12:36:18 +0100 |
| commit | 5b0eaf76ec00192c755b268b7655f6463c5bc62f (patch) | |
| tree | cf7c04ce21d0da964172ef35deb45c843aea8b98 /simulator/opendc-runner-web | |
| parent | ccd1f96f8568978c80aa0b9a100ca6158ade34ba (diff) | |
compute: Migrate compute service simulator to OpenTelemetry
This change updates the compute service simulator to use OpenTelemetry
for reporting metrics of the (simulated) hosts as opposed to using
custom event flows.
This approach is more generic, flexible and possibly offers better
performance as we can collect metrics of all services in a single sweep,
as opposed to listening to several services and each invoking the
handlers.
Diffstat (limited to 'simulator/opendc-runner-web')
| -rw-r--r-- | simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt index 706efdc9..5b717ff7 100644 --- a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt +++ b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt @@ -34,7 +34,6 @@ import com.mongodb.client.MongoClients import com.mongodb.client.MongoCollection import com.mongodb.client.MongoDatabase import com.mongodb.client.model.Filters -import io.opentelemetry.api.metrics.Meter import io.opentelemetry.api.metrics.MeterProvider import io.opentelemetry.sdk.metrics.SdkMeterProvider import io.opentelemetry.sdk.metrics.export.MetricProducer @@ -226,7 +225,6 @@ public class RunnerCli : CliktCommand(name = "runner") { .setClock(clock.toOtelClock()) .build() val metricProducer = meterProvider as MetricProducer - val meter: Meter = meterProvider.get("opendc-compute") val operational = scenario.get("operational", Document::class.java) val allocationPolicy = @@ -254,7 +252,7 @@ public class RunnerCli : CliktCommand(name = "runner") { val environment = TopologyParser(topologies, topologyId) val failureFrequency = operational.get("failureFrequency", Number::class.java)?.toDouble() ?: 24.0 * 7 - withComputeService(clock, meter, environment, allocationPolicy) { scheduler -> + withComputeService(clock, meterProvider, environment, allocationPolicy) { scheduler -> val failureDomain = if (failureFrequency > 0) { logger.debug { "ENABLING failures" } createFailureDomain( |
