From 1540b2dae6321a49ba4000c54fa5d4f3e6c540d4 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 25 Jul 2023 11:29:21 +0200 Subject: [PATCH 1/4] Import class --- tests/Feature/WorkCommandTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Feature/WorkCommandTest.php b/tests/Feature/WorkCommandTest.php index aa0e0da1..e0364076 100644 --- a/tests/Feature/WorkCommandTest.php +++ b/tests/Feature/WorkCommandTest.php @@ -1,5 +1,7 @@ $startedAt->diffInMilliseconds(now()), From 27ec605b7cf30fba91ce9cb79bbe44d354988f0c Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 25 Jul 2023 11:39:48 +0200 Subject: [PATCH 2/4] wip --- tests/Feature/WorkCommandTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Feature/WorkCommandTest.php b/tests/Feature/WorkCommandTest.php index e0364076..12375ee4 100644 --- a/tests/Feature/WorkCommandTest.php +++ b/tests/Feature/WorkCommandTest.php @@ -1,13 +1,13 @@ $startedAt->diffInMilliseconds(now()), - 'route' => 'GET /users', - 'user_id' => 5, - ]); + // RedisAdapter::xadd('pulse_requests', [ + // 'duration' => $startedAt->diffInMilliseconds(now()), + // 'route' => 'GET /users', + // 'user_id' => 5, + // ]); - expect(true)->toBeTrue(); -}); + // expect(true)->toBeTrue(); +})->todo(); From d228ebdc99341151a4480a0a0646453109f8907d Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 25 Jul 2023 11:42:54 +0200 Subject: [PATCH 3/4] wip --- src/Handlers/HttpRequestMiddleware.php | 2 +- src/Pulse.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Handlers/HttpRequestMiddleware.php b/src/Handlers/HttpRequestMiddleware.php index 9de777aa..7540bcbb 100644 --- a/src/Handlers/HttpRequestMiddleware.php +++ b/src/Handlers/HttpRequestMiddleware.php @@ -31,7 +31,7 @@ public function __invoke(callable $handler) rescue(fn () => $this->record($request, $startedAt, new CarbonImmutable), report: false); return $response; - }, function ($exception) { + }, function ($exception) use ($request, $startedAt) { rescue(fn () => $this->record($request, $startedAt, new CarbonImmutable), report: false); return new RejectedPromise($exception); diff --git a/src/Pulse.php b/src/Pulse.php index 454420a3..71748241 100644 --- a/src/Pulse.php +++ b/src/Pulse.php @@ -148,7 +148,7 @@ public static function auth(Closure $callback): static { static::$authUsing = $callback; - return new static; + return new self; } /** @@ -158,6 +158,6 @@ public static function ignoreMigrations(): static { static::$runsMigrations = false; - return new static; + return new self; } } From 84c063b9498bffd92d44d1d9a5fed8b0e56b1e98 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 25 Jul 2023 11:45:02 +0200 Subject: [PATCH 4/4] wip --- src/Commands/WorkCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Commands/WorkCommand.php b/src/Commands/WorkCommand.php index 28c2a01d..48242649 100644 --- a/src/Commands/WorkCommand.php +++ b/src/Commands/WorkCommand.php @@ -255,6 +255,7 @@ public function handlex(Redis $redis) // $allRequests = collect($redis->xrange('pulse_requests', '-', '+')); // dump($allRequests->keys()->first(), $allRequests->keys()->last(), $allRequests->count()); + return 0; } protected function getAggregates($from, $requests)