From 6c896a4a29147a863d797ac5bd5a210d4a9a78ef Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 10 Oct 2022 11:05:11 +0200 Subject: fix(compute/service): Expose number of registered servers This change updates the compute service telemetry to also expose the number of servers that are registered with the service. --- .../kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt | 1 + .../main/kotlin/org/opendc/compute/service/telemetry/SchedulerStats.kt | 2 ++ 2 files changed, 3 insertions(+) (limited to 'opendc-compute') diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt index caa95e09..0fe016aa 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt @@ -295,6 +295,7 @@ internal class ComputeServiceImpl( _attemptsSuccess, _attemptsFailure, _attemptsError, + servers.size, _serversPending, _serversActive ) diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/telemetry/SchedulerStats.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/telemetry/SchedulerStats.kt index 4dc70286..6e9f458a 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/telemetry/SchedulerStats.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/telemetry/SchedulerStats.kt @@ -32,6 +32,7 @@ import org.opendc.compute.service.ComputeService * @property attemptsSuccess Scheduling attempts that resulted into an allocation onto a host. * @property attemptsFailure The number of failed scheduling attempt due to insufficient capacity at the moment. * @property attemptsError The number of scheduling attempts that failed due to system error. + * @property serversTotal The number of servers registered with the service. * @property serversPending The number of servers that are pending to be scheduled. * @property serversActive The number of servers that are currently managed by the service and running. */ @@ -41,6 +42,7 @@ public data class SchedulerStats( val attemptsSuccess: Long, val attemptsFailure: Long, val attemptsError: Long, + val serversTotal: Int, val serversPending: Int, val serversActive: Int ) -- cgit v1.2.3