app(telemetry): disable server_usage for eggs and nests

This commit is contained in:
Matthew Penner 2022-12-12 15:57:41 -07:00
parent 680bce6d94
commit 8978da335e
No known key found for this signature in database

View file

@ -141,10 +141,12 @@ class TelemetryCollectionService
'eggs' => [ 'eggs' => [
'count' => Egg::count(), 'count' => Egg::count(),
'server_usage' => Egg::all() // Egg UUIDs are generated randomly on import, so there is not a consistent way to
->flatMap(fn (Egg $egg) => [$egg->uuid => $egg->servers->count()]) // determine if servers are using default eggs or not.
->filter(fn (int $count) => $count > 0) // 'server_usage' => Egg::all()
->toArray(), // ->flatMap(fn (Egg $egg) => [$egg->uuid => $egg->servers->count()])
// ->filter(fn (int $count) => $count > 0)
// ->toArray(),
], ],
'locations' => [ 'locations' => [
@ -157,10 +159,12 @@ class TelemetryCollectionService
'nests' => [ 'nests' => [
'count' => Nest::count(), 'count' => Nest::count(),
'server_usage' => Nest::all() // Nest UUIDs are generated randomly on import, so there is not a consistent way to
->flatMap(fn (Nest $nest) => [$nest->uuid => $nest->eggs->sum(fn (Egg $egg) => $egg->servers->count())]) // determine if servers are using default eggs or not.
->filter(fn (int $count) => $count > 0) // 'server_usage' => Nest::all()
->toArray(), // ->flatMap(fn (Nest $nest) => [$nest->uuid => $nest->eggs->sum(fn (Egg $egg) => $egg->servers->count())])
// ->filter(fn (int $count) => $count > 0)
// ->toArray(),
], ],
'nodes' => [ 'nodes' => [