Skip to content

Commit

Permalink
Remove redundant eloquent query tracking code because we already dire…
Browse files Browse the repository at this point in the history
…ctly inspect PDO calls
  • Loading branch information
benpoulson committed Jan 11, 2024
1 parent 13ee0bb commit 69d820f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function up(): void
$table->string('server_name');
$table->boolean('ajax')->default(false);
$table->longText('perfdata');
$table->longText('queries')->nullable();
$table->longText('cookie');
$table->longText('post');
$table->longText('get');
Expand Down
9 changes: 0 additions & 9 deletions src/Http/Middleware/BprofMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Illuminate\Support\Facades\Auth;
use Nexelity\Bprof\BprofLib;
use Nexelity\Bprof\DTO\QueryTrace;
use Nexelity\Bprof\LaravelBprofService;
use Nexelity\Bprof\Models\Trace;
use Ramsey\Uuid\Uuid;
use Symfony\Component\HttpFoundation\Response;
Expand Down Expand Up @@ -50,9 +49,6 @@ public function handle($request, Closure $next, ...$guards)
throw new RuntimeException('BProf extension is not loaded');
}

// Reset queries
LaravelBprofService::$queries = [];

// Start profiling
bprof_enable();

Expand All @@ -75,10 +71,6 @@ public function handle($request, Closure $next, ...$guards)
$totals = [];
$bprof->computeFlatInfo($perfdata, $totals);

// Get queries
$queries = LaravelBprofService::$queries;
LaravelBprofService::$queries = [];

/** @var array<string> $excludedParams */
$excludedParams = config('bprof.excluded_params', ['password']);

Expand Down Expand Up @@ -112,7 +104,6 @@ public function handle($request, Closure $next, ...$guards)
'cookie' => serialize($request->cookie()),
'post' => serialize($post),
'get' => serialize($get),
'queries' => array_map(static fn(QueryTrace $query) => $query->toArray(), $queries),
'user_id' => auth()->id(),
'ip' => $request->ip(),
]);
Expand Down
146 changes: 0 additions & 146 deletions src/LaravelBprofService.php

This file was deleted.

9 changes: 0 additions & 9 deletions src/LaravelBprofServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ public function boot()
// Publish migrations
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');

// Bind to events
Event::listen(QueryExecuted::class, static function (QueryExecuted $event) {
LaravelBprofService::handleQueryExecutedEvent(
type: 'sql',
connection: $event->connection->getName(),
query: LaravelBprofService::replaceBindings($event),
time: $event->time
);
});
}

/**
Expand Down

0 comments on commit 69d820f

Please sign in to comment.