Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Oct 13, 2023
1 parent 71c0718 commit 802fa83
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/views/livewire/slow-jobs.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<x-pulse::card-header
name="Slow Jobs"
title="Time: {{ number_format($time, 4) }}ms; Run at: {{ $runAt }};"
details="{{ config('pulse.slow_job_threshold') }}ms threshold, past {{ $this->periodForHumans() }}"
details="{{ $threshold }}ms threshold, past {{ $this->periodForHumans() }}"
>
<x-slot:icon>
<x-pulse::icons.command-line />
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/slow-outgoing-requests.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<x-pulse::card-header
name="Slow Outgoing Requests"
title="Time: {{ number_format($time, 4) }}ms; Run at: {{ $runAt }};"
details="{{ config('pulse.slow_outgoing_request_threshold') }}ms threshold, past {{ $this->periodForHumans() }}"
details="{{ $threshold }}ms threshold, past {{ $this->periodForHumans() }}"
>
<x-slot:icon>
<x-pulse::icons.cloud-arrow-up />
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/slow-queries.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<x-pulse::card-header
name="Slow Queries"
title="Time: {{ number_format($time, 4) }}ms; Run at: {{ $runAt }};"
details="{{ config('pulse.slow_query_threshold') }}ms threshold, past {{ $this->periodForHumans() }}"
details="{{ $threshold }}ms threshold, past {{ $this->periodForHumans() }}"
>
<x-slot:icon>
<x-pulse::icons.circle-stack />
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/slow-routes.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<x-pulse::card-header
name="Slow Routes"
title="Time: {{ number_format($time, 4) }}ms; Run at: {{ $runAt }};"
details="{{ config('pulse.slow_endpoint_threshold') }}ms threshold, past {{ $this->periodForHumans() }}"
details="{{ $threshold }}ms threshold, past {{ $this->periodForHumans() }}"
>
<x-slot:icon>
<x-pulse::icons.arrows-left-right />
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/usage.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
default => 'Application Usage'
}"
title="Time: {{ number_format($time, 4) }}ms; Run At: {{ $runAt }};"
details="{{ $this->usage === 'slow_endpoint_counts' ? (config('pulse.slow_endpoint_threshold').'ms threshold, ') : '' }}past {{ $this->periodForHumans() }}"
details="{{ $this->usage === 'slow_endpoint_counts' ? ($threshold.'ms threshold, ') : '' }}past {{ $this->periodForHumans() }}"
>
<x-slot:icon>
<x-dynamic-component :component="'pulse::icons.' . match ($this->type) {
Expand Down
3 changes: 3 additions & 0 deletions src/Livewire/SlowJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace Laravel\Pulse\Livewire;

use Illuminate\Contracts\Support\Renderable;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\View;
use Laravel\Pulse\Queries\SlowJobs as SlowJobsQuery;
use Laravel\Pulse\Recorders\Jobs;
use Livewire\Attributes\Lazy;

#[Lazy]
Expand All @@ -22,6 +24,7 @@ public function render(SlowJobsQuery $query): Renderable
return View::make('pulse::livewire.slow-jobs', [
'time' => $time,
'runAt' => $runAt,
'threshold' => Config::get('pulse.recorders.'.Jobs::class.'.threshold'),
'slowJobs' => $slowJobs,
]);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Livewire/SlowOutgoingRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Client\Factory;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\View;
use Laravel\Pulse\Queries\SlowOutgoingRequests as SlowOutgoingRequestsQuery;
use Laravel\Pulse\Recorders\OutgoingRequests;
use Livewire\Attributes\Lazy;

#[Lazy]
Expand All @@ -23,6 +25,7 @@ public function render(SlowOutgoingRequestsQuery $query): Renderable
return View::make('pulse::livewire.slow-outgoing-requests', [
'time' => $time,
'runAt' => $runAt,
'threshold' => Config::get('pulse.recorders.'.OutgoingRequests::class.'.threshold'),
'slowOutgoingRequests' => $slowOutgoingRequests,
'supported' => method_exists(Factory::class, 'globalMiddleware'),
]);
Expand Down
3 changes: 3 additions & 0 deletions src/Livewire/SlowQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace Laravel\Pulse\Livewire;

use Illuminate\Contracts\Support\Renderable;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\View;
use Laravel\Pulse\Queries\SlowQueries as SlowQueriesQuery;
use Laravel\Pulse\Recorders\SlowQueries as SlowQueriesRecorder;
use Livewire\Attributes\Lazy;

#[Lazy]
Expand All @@ -22,6 +24,7 @@ public function render(SlowQueriesQuery $query): Renderable
return View::make('pulse::livewire.slow-queries', [
'time' => $time,
'runAt' => $runAt,
'threshold' => Config::get('pulse.recorders.'.SlowQueriesRecorder::class.'.threshold'),
'slowQueries' => $slowQueries,
]);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Livewire/SlowRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace Laravel\Pulse\Livewire;

use Illuminate\Contracts\Support\Renderable;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\View;
use Laravel\Pulse\Queries\SlowRoutes as SlowRoutesQuery;
use Laravel\Pulse\Recorders\Requests;
use Livewire\Attributes\Lazy;

#[Lazy]
Expand All @@ -22,6 +24,7 @@ public function render(SlowRoutesQuery $query): Renderable
return View::make('pulse::livewire.slow-routes', [
'time' => $time,
'runAt' => $runAt,
'threshold' => Config::get('pulse.recorders.'.Requests::class.'.threshold'),
'slowRoutes' => $slowRoutes,
]);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Livewire/Usage.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace Laravel\Pulse\Livewire;

use Illuminate\Contracts\Support\Renderable;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\View;
use Laravel\Pulse\Queries\Usage as UsageQuery;
use Laravel\Pulse\Recorders\Requests;
use Livewire\Attributes\Lazy;
use Livewire\Attributes\Url;

Expand Down Expand Up @@ -40,6 +42,7 @@ public function render(UsageQuery $query): Renderable
return View::make('pulse::livewire.usage', [
'time' => $time,
'runAt' => $runAt,
'threshold' => Config::get('pulse.recorders.'.Requests::class.'.threshold'),
'userRequestCounts' => $userRequestCounts,
]);
}
Expand Down

0 comments on commit 802fa83

Please sign in to comment.