Skip to content

Commit

Permalink
Removed debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
Radiergummi committed Sep 20, 2022
1 parent 9512aba commit 29fa8e2
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/Http/Middleware/ServerTimingMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Matchory\ServerTiming\ServerTiming;
use Symfony\Component\HttpFoundation\Response;
Expand Down Expand Up @@ -33,17 +32,6 @@ public function handle(Request $request, Closure $next): Response
}

$this->timing->setDuration('Bootstrap', $this->getElapsedTime());
if ( ! $this->isOctane()) {
Log::error('Not Octane - adding bootstrap time', [
'LARAVEL_OCTANE' => $_SERVER['LARAVEL_OCTANE'] ?? null,
]);
} else {
Log::error('Inside Octane - omitting bootstrap time', [
'LARAVEL_OCTANE' => $_SERVER['LARAVEL_OCTANE'] ?? null,
]);

}

$this->timing->start('App');

$response = $next($request);
Expand All @@ -52,10 +40,7 @@ public function handle(Request $request, Closure $next): Response
$this->timing->stopAllUnfinishedEvents();

$total = array_sum($this->timing->events());
# $this->timing->setDuration('Total', $total);

# if ( ! $this->isOctane()) {
# }
$this->timing->setDuration('Total', $total);

$response->headers->set(self::HEADER, $this->generateHeaders());

Expand Down Expand Up @@ -87,9 +72,4 @@ protected function getElapsedTime(): float
{
return (microtime(true) - $this->timing->getStart()) * 1000;
}

private function isOctane(): bool
{
return (bool)($_SERVER['LARAVEL_OCTANE'] ?? false);
}
}

0 comments on commit 29fa8e2

Please sign in to comment.