From 8978da335e23fb16a01089cca123c20a651043dd Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Mon, 12 Dec 2022 15:57:41 -0700 Subject: [PATCH] app(telemetry): disable server_usage for eggs and nests --- .../Telemetry/TelemetryCollectionService.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/Services/Telemetry/TelemetryCollectionService.php b/app/Services/Telemetry/TelemetryCollectionService.php index 6c1b527ef..da749404f 100644 --- a/app/Services/Telemetry/TelemetryCollectionService.php +++ b/app/Services/Telemetry/TelemetryCollectionService.php @@ -141,10 +141,12 @@ class TelemetryCollectionService 'eggs' => [ 'count' => Egg::count(), - 'server_usage' => Egg::all() - ->flatMap(fn (Egg $egg) => [$egg->uuid => $egg->servers->count()]) - ->filter(fn (int $count) => $count > 0) - ->toArray(), + // Egg UUIDs are generated randomly on import, so there is not a consistent way to + // determine if servers are using default eggs or not. +// 'server_usage' => Egg::all() +// ->flatMap(fn (Egg $egg) => [$egg->uuid => $egg->servers->count()]) +// ->filter(fn (int $count) => $count > 0) +// ->toArray(), ], 'locations' => [ @@ -157,10 +159,12 @@ class TelemetryCollectionService 'nests' => [ 'count' => Nest::count(), - 'server_usage' => Nest::all() - ->flatMap(fn (Nest $nest) => [$nest->uuid => $nest->eggs->sum(fn (Egg $egg) => $egg->servers->count())]) - ->filter(fn (int $count) => $count > 0) - ->toArray(), + // Nest UUIDs are generated randomly on import, so there is not a consistent way to + // determine if servers are using default eggs or not. +// 'server_usage' => Nest::all() +// ->flatMap(fn (Nest $nest) => [$nest->uuid => $nest->eggs->sum(fn (Egg $egg) => $egg->servers->count())]) +// ->filter(fn (int $count) => $count > 0) +// ->toArray(), ], 'nodes' => [