Skip to content

Commit 4b180c7

Browse files
committed
Add collectors
1 parent fbe80c8 commit 4b180c7

20 files changed

+195
-27
lines changed

docs/collectors.md

+195-27
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ hide:
66

77
Debugbar can slow the application down (because it has to gather and render data). So when experiencing slowness, try disabling some of the collectors.
88

9-
## Collectors
9+
# Collectors
1010

1111
This package includes with these Collectors enabled by default:
1212

@@ -16,24 +16,27 @@ This package includes with these Collectors enabled by default:
1616
- [Views](#views): Show the currently loaded views.
1717
- [Timeline](#time): Timeline with Booting and Application timing
1818
- [Route](#route): Show information about the current Route.
19-
- Session: Current session data
20-
- Request: Request data
21-
- Livewire: Only active when Livewire is used
22-
- PhpInfo: Current PHP version
23-
- Memory: Memory usage
24-
- Exceptions: Errors with stacktrace
19+
- [Exceptions](#exceptions): Exceptions and Throwable with stacktrace
20+
- [Session](#session): Current session data
21+
- [Request](#request): Request data
22+
- [Livewire](#livewire): Only active when Livewire is used
23+
- [PhpInfo](#phpinfo): Current PHP version
24+
2525

2626
These collectors can be enabled in the config:
2727

28-
- Auth: Logged in status
29-
- Events: Show all events
30-
- Mail: Sent emails
31-
- Gates: Show the gates that are checked
32-
- Laravel Info: Show the Laravel version and Environment.
33-
- Files: Show the files that are included/required by PHP.
34-
- Config: Display the values from the config files.
35-
- Cache: Display all cache events.
36-
- Pennant: Show Pennant flags
28+
- [Gate](#gate): Show the gates that are checked
29+
- [Events](#events): Show all events
30+
- [Auth](#auth): Logged in status
31+
32+
- [Mail](#mail): Sent emails
33+
34+
- [Laravel Info](#laravel): Show the Laravel version and Environment.
35+
- [Memory](#memory): Memory usage
36+
- [Files](#files): Show the files that are included/required by PHP.
37+
- [Config](#config): Display the values from the config files.
38+
- [Cache](#cache): Display all cache events.
39+
- [Pennant](#pennant): Show Pennant flags
3740

3841
To enable or disable any of the collectors, set the configuration to `true` or `false`. Some collector have additional options in the configuration:
3942

@@ -85,7 +88,7 @@ To enable or disable any of the collectors, set the configuration to `true` or `
8588

8689
</details>
8790

88-
### Query Collector { #db }
91+
## Query Collector { #db }
8992

9093
<!-- md:version v1.0 -->
9194
<!-- md:feature collectors.db -->
@@ -134,7 +137,7 @@ The Query Collector has the following features
134137
```
135138
</details>
136139

137-
#### On-demand query EXPLAIN
140+
### On-demand query EXPLAIN
138141

139142
<!-- md:version v3.14.0 -->
140143
<!-- md:flag experimental -->
@@ -146,7 +149,7 @@ This will update in the interface. You also have an option to navigate to mysqle
146149
![Query On-demand Explain](img/query-explain.gif)
147150

148151

149-
#### Query limits
152+
### Query limits
150153

151154
<!-- md:version v3.10.0 -->
152155
<!-- md:feature options.db.soft_limit: 100 -->
@@ -186,7 +189,7 @@ When the [Messages Collector](#messages) is enabled, Log messages are added to t
186189

187190
![Monolog](img/monolog.png)
188191

189-
### ViewCollector { #views }
192+
## Views { #views }
190193

191194
<!-- md:version v1.0 -->
192195
<!-- md:feature collectors.views -->
@@ -215,7 +218,26 @@ The ViewCollector shows views and has the following features:
215218

216219
```
217220

218-
### RouteCollector { #route }
221+
## Timeline { #time }
222+
223+
<!-- md:version v1.0 -->
224+
<!-- md:feature collectors.time -->
225+
226+
![Timeline Collector](img/timeline.png)
227+
228+
<details><summary>config/debugbar.php</summary>
229+
230+
```php
231+
'options' => [
232+
'time' => [
233+
'memory_usage' => false, // Calculated by subtracting memory start and end, it may be inaccurate
234+
],
235+
]
236+
```
237+
238+
</details>
239+
240+
## Route { #route }
219241

220242
<!-- md:version v1.0 -->
221243
<!-- md:feature collectors.route -->
@@ -224,23 +246,167 @@ This shows the current route and middleware.
224246

225247
![RouteCollector](img/route.png)
226248

227-
### Timeline Collector { #time }
249+
## Exceptions { #exceptions }
228250

229251
<!-- md:version v1.0 -->
230-
<!-- md:feature collectors.time -->
252+
<!-- md:feature collectors.exceptions -->
231253

232-
![Timeline Collector](img/timeline.png)
254+
Show any errors from the application, including traces.
255+
256+
You can manually add exceptions by calling `debugbar()->addThrowable($throwable);`
257+
258+
![ExceptionCollector](img/exceptions.png)
259+
260+
## Session { #session }
261+
262+
<!-- md:version v1.0 -->
263+
<!-- md:feature collectors.phpinfo -->
264+
<!-- md:default false -->
265+
266+
A simple widget showing the current PHP Version.
267+
268+
![Session Collector](img/session.png)
269+
270+
271+
## Request { #request }
272+
273+
<!-- md:version v1.0 -->
274+
<!-- md:feature collectors.request -->
275+
276+
Show Request info, like headers, data, cookies etc.
277+
278+
![Request Collector](img/request.png)
279+
280+
## Livewire { #livewire }
281+
282+
<!-- md:version v3.3.3 -->
283+
<!-- md:feature collectors.livewire -->
284+
285+
Show the Livewire components that are rendered on the page.
286+
287+
![Livewire Collector](img/livewire.png)
288+
289+
290+
## PHP Info { #phpinfo }
291+
292+
<!-- md:version v1.0 -->
293+
<!-- md:feature collectors.phpinfo -->
294+
295+
A simple widget showing the current PHP Version.
296+
297+
![PhpInfo Collector](img/phpinfo.png)
298+
299+
## Gate { #gate }
300+
301+
<!-- md:version v2.1.0 -->
302+
<!-- md:feature collectors.gate -->
303+
<!-- md:default false -->
304+
305+
The Gate Collector shows the checks that have passed or failed.
306+
307+
![Gate Collector](img/gate.png)
308+
309+
## Events { #events }
310+
311+
<!-- md:version v1.0 -->
312+
<!-- md:feature collectors.events -->
313+
314+
This is similar to the Timeline buts adds all events. This can be a lot of data, so use with caution.
315+
316+
![Events](img/events.gif)
317+
318+
## Auth { #auth }
319+
320+
<!-- md:version v1.2.2 -->
321+
<!-- md:feature collectors.auth -->
322+
<!-- md:default false -->
323+
324+
A widget showing the current login status + a collector with more information.
325+
326+
![Auth Collector](img/auth.png)
327+
328+
## Mail { #mail }
329+
330+
<!-- md:version v1.0 -->
331+
<!-- md:feature collectors.mail -->
332+
<!-- md:default false -->
333+
334+
A collector showing the sent emails.
335+
336+
![Mail Collector](img/mail.png)
337+
338+
### Mail Preview
339+
340+
<!-- md:version v3.12.0 -->
341+
<!-- md:feature options.mail.show_body -->
342+
<!-- md:default true -->
343+
344+
You can open a rendered preview of the email when the body is attached, by clicking 'View Mail'
345+
346+
![Mail Preview](img/mail-preview.png)
347+
348+
## Laravel Info { #laravel }
349+
350+
<!-- md:version v1.0 -->
351+
<!-- md:feature collectors.laravel -->
352+
<!-- md:default false -->
353+
354+
A widget showing the current Laravel Version, environment and locale.
355+
356+
![Laravel Collector](img/laravel-info.png)
357+
358+
## Memory Usage { #memory }
359+
360+
<!-- md:version v1.0 -->
361+
<!-- md:feature collectors.memory -->
362+
<!-- md:default false -->
363+
364+
Show the Memory Usage of the application
365+
366+
<details><summary>config/debugbar.php</summary>
233367

234368
```php
235369
'options' => [
236-
'time' => [
237-
'memory_usage' => false, // Calculated by subtracting memory start and end, it may be inaccurate
370+
'memory' => [
371+
'reset_peak' => false, // run memory_reset_peak_usage before collecting
372+
'with_baseline' => false, // Set boot memory usage as memory peak baseline
373+
'precision' => 0, // Memory rounding precision
238374
],
239375
]
240376
```
241377

378+
</details>
379+
380+
![Memory Collector](img/memory.png)
381+
382+
## Files { #files }
383+
384+
<!-- md:version v1.0 -->
385+
<!-- md:feature collectors.files -->
386+
<!-- md:default false -->
387+
388+
## Config { #config }
389+
390+
<!-- md:version v1.0 -->
391+
<!-- md:feature collectors.config -->
392+
<!-- md:default false -->
393+
394+
## Cache { #memory }
395+
396+
<!-- md:version v1.0 -->
397+
<!-- md:feature collectors.files -->
398+
<!-- md:default false -->
399+
400+
## Pennant { #pennant }
401+
402+
<!-- md:version v3.14-->
403+
<!-- md:feature collectors.pennant -->
404+
<!-- md:default false -->
405+
242406
## Additional options
243407

408+
<details><summary>config/debugbar.php</summary>
409+
244410
```php
245411
/*
246412
|--------------------------------------------------------------------------
@@ -297,4 +463,6 @@ This shows the current route and middleware.
297463
],
298464
],
299465

300-
```
466+
```
467+
468+
</details>

docs/img/auth.png

22.3 KB
Loading

docs/img/events.gif

1.09 MB
Loading

docs/img/exceptions.png

57.3 KB
Loading

docs/img/gate.png

44.8 KB
Loading

docs/img/laravel-info.png

6.42 KB
Loading

docs/img/livewire.png

48.3 KB
Loading

docs/img/mail-preview.png

66.5 KB
Loading

docs/img/mail.png

22.6 KB
Loading

docs/img/memory.png

5.43 KB
Loading

docs/img/monolog.png

5.87 KB
Loading

docs/img/phpinfo.png

5.16 KB
Loading

docs/img/queries.png

17.5 KB
Loading

docs/img/query-explain.gif

173 KB
Loading

docs/img/request.png

30.2 KB
Loading

docs/img/rotue.png

25 KB
Loading

docs/img/route.png

-22.6 KB
Binary file not shown.

docs/img/session.png

27.4 KB
Loading

docs/img/timeline.png

-1.04 KB
Loading

docs/img/views.png

10.3 KB
Loading

0 commit comments

Comments
 (0)