From 250c557e2311af8a04f8bafbddb0abf049d8b601 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Thu, 1 Dec 2022 12:09:27 -0700 Subject: [PATCH] telemetry: include more detailed server egg and nest usage --- app/Services/Telemetry/TelemetryCollectionService.php | 11 ++++++++++- config/pterodactyl.php | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Services/Telemetry/TelemetryCollectionService.php b/app/Services/Telemetry/TelemetryCollectionService.php index c23f41dc0..ca157694e 100644 --- a/app/Services/Telemetry/TelemetryCollectionService.php +++ b/app/Services/Telemetry/TelemetryCollectionService.php @@ -116,9 +116,11 @@ class TelemetryCollectionService 'backup' => [ 'type' => config('backups.default'), ], + 'cache' => [ 'type' => config('cache.default'), ], + 'database' => [ 'type' => config('database.default'), 'version' => DB::getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), @@ -139,7 +141,10 @@ class TelemetryCollectionService 'eggs' => [ 'count' => Egg::count(), - 'ids' => Egg::pluck('uuid')->toArray(), + 'server_usage' => Egg::all() + ->flatMap(fn (Egg $egg) => [$egg->uuid => $egg->servers->count()]) + ->filter(fn (int $count) => $count > 0) + ->toArray(), ], 'locations' => [ @@ -152,6 +157,10 @@ 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(), ], 'nodes' => [ diff --git a/config/pterodactyl.php b/config/pterodactyl.php index e5ceb3525..43c7c57be 100644 --- a/config/pterodactyl.php +++ b/config/pterodactyl.php @@ -187,6 +187,6 @@ return [ */ 'telemetry' => [ - 'enabled' => env('PTERODACTYL_TELEMETRY_ENABLED', false), + 'enabled' => env('PTERODACTYL_TELEMETRY_ENABLED', true), ], ];