Find slow database queries or N+1 query problems in a Laravel app by viewing a visual timeline of every request.
Debug a PHP API consumed by a mobile client by opening Clockwork built-in web interface at /clockwork to inspect requests without a browser extension.
Profile which part of a PHP request takes the longest by wrapping code blocks with Clockwork timeline start and end markers.
Requires installing a companion browser extension or using the /clockwork web interface alongside the Composer package.
Clockwork is a debugging and profiling tool for PHP applications that shows runtime information directly in a web browser. This repository contains the server-side component, installed via Composer and paired with a browser extension or a built-in web interface. When active, Clockwork collects data for every HTTP request the application handles, and optionally for artisan commands, queued jobs, and tests when those features are enabled in the config. The collected information includes request and response details, executed database queries with timing, cache operations, Redis commands, dispatched events, queued jobs, rendered views, log messages, and a visual performance timeline. A browser extension for Chrome and Firefox adds a Clockwork panel to the developer tools, while visiting /clockwork in the app opens a standalone interface that lists all recorded requests, which is useful when building an API consumed by a mobile client rather than a browser. By default Clockwork activates only when the app is in debug mode. The configuration file allows narrowing this further: collecting only when the browser extension is open, only for slow requests, only for error responses, or filtered by a custom condition. Config options also include a slow query threshold, detection of duplicate N+1 queries, and a limit on stored stack trace frames per log entry. Logging from application code is done through a clock() helper that accepts any value, including arrays and objects, and an optional log level. A timeline API lets developers mark the start and end of any code block so it appears as a colored bar in the visual timeline, making it straightforward to see where time is spent during a request.
← itsgoingd on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.