Skip to content

Commit 5d79cd5

Browse files
timacdonaldgithub-actions[bot]
authored andcommitted
Fix code styling
1 parent e3d4c01 commit 5d79cd5

File tree

5 files changed

+5
-16
lines changed

5 files changed

+5
-16
lines changed

src/Commands/CheckCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Laravel\Pulse\Commands;
44

55
use Carbon\CarbonImmutable;
6-
use Carbon\CarbonInterval;
76
use Illuminate\Console\Command;
87
use Illuminate\Contracts\Cache\LockProvider;
98
use Illuminate\Events\Dispatcher;

src/Events/IsolatedBeat.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Laravel\Pulse\Events;
44

55
use Carbon\CarbonImmutable;
6-
use Carbon\CarbonInterval;
76

87
class IsolatedBeat
98
{

src/Events/SharedBeat.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Laravel\Pulse\Events;
44

55
use Carbon\CarbonImmutable;
6-
use Carbon\CarbonInterval;
76

87
class SharedBeat
98
{

src/Recorders/Concerns/Intervals.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
namespace Laravel\Pulse\Recorders\Concerns;
44

55
use DateInterval;
6-
use DateTimeInterface;
7-
use Illuminate\Support\Facades\App;
86
use Illuminate\Support\Facades\RateLimiter;
9-
use Illuminate\Support\Str;
107
use Laravel\Pulse\Events\IsolatedBeat;
118
use Laravel\Pulse\Events\SharedBeat;
12-
use Laravel\Pulse\Support\CacheStoreResolver;
139

1410
trait Intervals
1511
{

src/Recorders/Servers.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
namespace Laravel\Pulse\Recorders;
44

55
use Carbon\CarbonInterval as Interval;
6-
use DateInterval;
7-
use DateTimeInterface;
86
use Illuminate\Config\Repository;
9-
use Illuminate\Support\Facades\App;
107
use Illuminate\Support\InteractsWithTime;
118
use Illuminate\Support\Str;
12-
use Laravel\Pulse\Events\IsolatedBeat;
139
use Laravel\Pulse\Events\SharedBeat;
1410
use Laravel\Pulse\Pulse;
1511
use Laravel\Pulse\Support\CacheStoreResolver;
@@ -20,7 +16,7 @@
2016
*/
2117
class Servers
2218
{
23-
use InteractsWithTime, Concerns\Intervals;
19+
use Concerns\Intervals, InteractsWithTime;
2420

2521
/**
2622
* The events to listen for.
@@ -55,23 +51,23 @@ public function record(SharedBeat $event): void
5551
'Linux' => intval(`cat /proc/meminfo | grep MemTotal | grep -E -o '[0-9]+'` / 1024),
5652
'Windows' => intval(((int) trim(`wmic ComputerSystem get TotalPhysicalMemory | more +1`)) / 1024 / 1024),
5753
'BSD' => intval(`sysctl hw.physmem | grep -Eo '[0-9]+'` / 1024 / 1024),
58-
default => throw new RuntimeException('The pulse:check command does not currently support '.PHP_OS_FAMILY),
54+
default => throw new RuntimeException('The pulse:check command does not currently support '.PHP_OS_FAMILY),
5955
};
6056

6157
$memoryUsed = match (PHP_OS_FAMILY) {
6258
'Darwin' => $memoryTotal - intval(intval(`vm_stat | grep 'Pages free' | grep -Eo '[0-9]+'`) * intval(`pagesize`) / 1024 / 1024), // MB
6359
'Linux' => $memoryTotal - intval(`cat /proc/meminfo | grep MemAvailable | grep -E -o '[0-9]+'` / 1024), // MB
6460
'Windows' => $memoryTotal - intval(((int) trim(`wmic OS get FreePhysicalMemory | more +1`)) / 1024), // MB
6561
'BSD' => intval(intval(`( sysctl vm.stats.vm.v_cache_count | grep -Eo '[0-9]+' ; sysctl vm.stats.vm.v_inactive_count | grep -Eo '[0-9]+' ; sysctl vm.stats.vm.v_active_count | grep -Eo '[0-9]+' ) | awk '{s+=$1} END {print s}'`) * intval(`pagesize`) / 1024 / 1024), // MB
66-
default => throw new RuntimeException('The pulse:check command does not currently support '.PHP_OS_FAMILY),
62+
default => throw new RuntimeException('The pulse:check command does not currently support '.PHP_OS_FAMILY),
6763
};
6864

6965
$cpu = match (PHP_OS_FAMILY) {
7066
'Darwin' => (int) `top -l 1 | grep -E "^CPU" | tail -1 | awk '{ print $3 + $5 }'`,
7167
'Linux' => (int) `top -bn1 | grep -E '^(%Cpu|CPU)' | awk '{ print $2 + $4 }'`,
7268
'Windows' => (int) trim(`wmic cpu get loadpercentage | more +1`),
7369
'BSD' => (int) `top -b -d 2| grep 'CPU: ' | tail -1 | awk '{print$10}' | grep -Eo '[0-9]+\.[0-9]+' | awk '{ print 100 - $1 }'`,
74-
default => throw new RuntimeException('The pulse:check command does not currently support '.PHP_OS_FAMILY),
70+
default => throw new RuntimeException('The pulse:check command does not currently support '.PHP_OS_FAMILY),
7571
};
7672

7773
$this->pulse->record('cpu', $slug, $cpu, $event->time)->avg()->onlyBuckets();
@@ -87,7 +83,7 @@ public function record(SharedBeat $event): void
8783
'total' => $total = intval(round(disk_total_space($directory) / 1024 / 1024)), // MB
8884
'used' => intval(round($total - (disk_free_space($directory) / 1024 / 1024))), // MB
8985
])
90-
->all(),
86+
->all(),
9187
], flags: JSON_THROW_ON_ERROR), $event->time);
9288
});
9389
}

0 commit comments

Comments
 (0)