Skip to content

Commit cabb2f4

Browse files
committed
feat(collectors): Add time field to ApplicationCollector
- Add 'time' field to collect method in ApplicationCollector - Set 'time' field value as current date and time
1 parent f54cd79 commit cabb2f4

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

config/exception-notify.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
*/
7474
'collectors' => [
7575
Guanguans\LaravelExceptionNotify\Collectors\ApplicationCollector::class,
76-
Guanguans\LaravelExceptionNotify\Collectors\ChoreCollector::class,
7776
Guanguans\LaravelExceptionNotify\Collectors\PhpInfoCollector::class,
77+
Guanguans\LaravelExceptionNotify\Collectors\ChoreCollector::class,
7878
Guanguans\LaravelExceptionNotify\Collectors\RequestBasicCollector::class,
7979
Guanguans\LaravelExceptionNotify\Collectors\ExceptionBasicCollector::class,
8080
Guanguans\LaravelExceptionNotify\Collectors\ExceptionContextCollector::class,
@@ -195,7 +195,6 @@
195195
],
196196
'pipes' => [
197197
hydrate_pipe(AddKeywordPipe::class, env('EXCEPTION_NOTIFY_DINGTALK_KEYWORD')),
198-
199198
hydrate_pipe(LimitLengthPipe::class, 20000),
200199
],
201200
],
@@ -244,7 +243,6 @@
244243
],
245244
'pipes' => [
246245
hydrate_pipe(AddKeywordPipe::class, env('EXCEPTION_NOTIFY_LARK_KEYWORD')),
247-
248246
hydrate_pipe(LimitLengthPipe::class, 30720),
249247
],
250248
],
@@ -271,7 +269,7 @@
271269
'message' => '{report}',
272270
],
273271
'pipes' => [
274-
// hydrate_pipe(LimitLengthPipe::class, 30720),
272+
hydrate_pipe(LimitLengthPipe::class, 1024),
275273
],
276274
],
277275

@@ -295,8 +293,7 @@
295293
],
296294
'pipes' => [
297295
SprintfMarkdownPipe::class,
298-
299-
// hydrate_pipe(LimitLengthPipe::class, 30720),
296+
hydrate_pipe(LimitLengthPipe::class, 4096),
300297
],
301298
],
302299

src/Collectors/ApplicationCollector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function __construct(Container $container)
2828
public function collect(): array
2929
{
3030
return [
31+
'time' => date('Y-m-d H:i:s'),
3132
'name' => config('app.name'),
3233
'version' => $this->container->version(),
3334
'environment' => $this->container->environment(),

src/Collectors/ChoreCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class ChoreCollector extends Collector
1818
public function collect(): array
1919
{
2020
return [
21-
'time' => date('Y-m-d H:i:s'),
22-
'memory' => human_bytes(memory_get_peak_usage(true)),
21+
// 'time' => date('Y-m-d H:i:s'),
22+
// 'memory' => human_bytes(memory_get_peak_usage(true)),
2323
];
2424
}
2525
}

src/Collectors/PhpInfoCollector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function collect(): array
2020
return [
2121
'version' => \PHP_VERSION,
2222
'interface' => \PHP_SAPI,
23+
'memory' => human_bytes(memory_get_peak_usage(true)),
2324
];
2425
}
2526
}

0 commit comments

Comments
 (0)