File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ public function record(SharedBeat $event): void
86
86
'memory_used ' => $ memoryUsed ,
87
87
'memory_total ' => $ memoryTotal ,
88
88
'storage ' => collect ($ this ->config ->get ('pulse.recorders. ' .self ::class.'.directories ' )) // @phpstan-ignore argument.templateType, argument.templateType
89
+ ->filter (fn (string $ directory ) => ($ this ->pulse ->rescue (fn () => disk_total_space ($ directory )) ?? false ) !== false )
89
90
->map (fn (string $ directory ) => [
90
91
'directory ' => $ directory ,
91
92
'total ' => $ total = intval (round (disk_total_space ($ directory ) / 1024 / 1024 )), // MB
Original file line number Diff line number Diff line change 62
62
Servers::detectCpuUsing (null );
63
63
Servers::detectMemoryUsing (null );
64
64
});
65
+
66
+ it ('skips missing filesystems when recording events ' , function () {
67
+ Pulse::handleExceptionsUsing (function () {
68
+ //
69
+ });
70
+ Config::set ('pulse.recorders. ' .Servers::class . '.directories ' , ['/ ' , '/nonexistent ' ]);
71
+ Date::setTestNow (Date::now ()->startOfMinute ());
72
+
73
+ event (new SharedBeat (CarbonImmutable::now (), 'instance-id ' ));
74
+ Pulse::ingest ();
75
+
76
+ $ value = Pulse::ignore (fn () => DB ::table ('pulse_values ' )->sole ());
77
+
78
+ $ payload = json_decode ($ value ->value );
79
+ expect ($ payload ->storage )->toHaveCount (1 );
80
+ });
You can’t perform that action at this time.
0 commit comments