aeatech/snapshot-profiler-contracts
Contracts/interfaces for integrating a snapshot-based profiler into Laravel/PHP apps. Provides the core abstractions used by the Snapshot Profiler package ecosystem for capturing, storing, and reporting performance snapshots across implementations.
return_type, attribute, or enum usage that might require adjustments.SnapshotProfiler, StorageAdapter), teams must build or adopt third-party solutions, increasing initial effort.Benchmark facade).AppServiceProvider.HandleIncomingRequest).job:failed, http:completed).config/app.php providers.// app/Providers/AppServiceProvider.php
public function register()
{
$this->app->bind(
\AeaTech\SnapshotProfilerContracts\SnapshotProfiler::class,
\App\Profilers\LogSnapshotProfiler::class
);
}
$profiler = app(SnapshotProfiler::class);
$profiler->start('route.handler');
// ... business logic ...
$profiler->snapshot()->store();
attributes or enums.Snapshot class) with existing tools.| Step | Priority | Dependencies |
|---|---|---|
| Define interfaces | High | None |
| Implement minimal profiler | High | Contracts, storage layer |
| Integrate into critical paths | Medium | Minimal profiler working |
| Add storage/processing | Low | Basic profiling in place |
| Dashboard/alerting | Low | Storage layer implemented |
APP_PROFILING_ENABLED=false).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Profiler crashes | Missing data, silent failures | Graceful degradation (e.g., log error, continue) |
| Storage backend fails | Lost snapshots | Fallback to local cache or disk |
| High snapshot volume | Database overload | Throttle collection or aggregate |
| Incompatible PHP version | Runtime errors | Polyfills or version pinning |
How can I help you explore Laravel packages today?