itsgoingd/clockwork
51.1
Adequate · 19 September 2026
9.2k
lines of production code
PHP
primary language
1
measurement over time
What this system is
Clockwork is a PHP debugging and profiling library that collects metadata from web requests, console commands, and queue jobs. It integrates with major frameworks like Laravel, Symfony, Slim, and Lumen to monitor performance metrics, database queries, HTTP interactions, and logs. The system provides a web interface and API to visualize this data, supporting various storage backends and extensible authentication.
How it got here
2013 — Initial release and framework integrations
8 changes.
This period marks the initial release of the Clockwork PHP developer tools, establishing core capabilities for debugging, profiling, and logging. The work focused on building integrations for major frameworks like Laravel, Slim, and Monolog, while introducing flexible data source architectures and multiple storage backends including SQL and Redis.
2014–2017 — Framework integrations and UI modernization
8 changes.
This period focused on expanding Clockwork's support to new PHP frameworks, including initial integration for Lumen and enhanced configuration options for Laravel. The work also involved modernizing the web interface by upgrading to Vue 3 and improving core data handling through new helper classes for serialization and stack traces. Additionally, security and maintenance tasks included securing asset serving and isolating legacy middleware for Slim 3.
2018–2024 — Framework integrations and debugging features
12 changes.
This period focused on expanding Clockwork's compatibility by adding support for Symfony, Slim 2, and vanilla PHP environments, alongside deep integrations with Doctrine and Twig. Significant enhancements were made to the debugging experience, including N+1 query detection, Laravel view path resolution, and detailed timeline event tracking for performance analysis.
Features
Add Slim 4 middleware with authentication and Server-Timing support
Introduces a new ClockworkMiddleware for Slim 4 applications that intercepts requests to log performance data, retrieve request history via the \\_\_clockwork\ endpoint (including fetching the latest record), and handle authentication. The middleware automatically attaches Server-Timing headers to responses and supports custom base paths, providing a complete integration layer for monitoring Slim 4 apps.
Clockwork/Support/Slim · high confidence
Added Clockwork routing configuration for Symfony
A new routing configuration file (clockwork.php) has been added to the Symfony support package. This file uses the Symfony RoutingConfigurator to import routes from the local directory under the 'clockwork' identifier, enabling the web UI routes to be registered within the Symfony application.
Clockwork/Support/Symfony/Resources/config/routing · high confidence
Added Doctrine 3+ logging middleware and legacy Doctrine 2.x logger support
Clockwork now supports logging database queries for both Doctrine DBAL 3+ and legacy Doctrine 2.x. For Doctrine 3+, a new middleware implementation (Middleware, Driver, Connection) intercepts queries via the DBAL driver middleware interface to capture execution time and SQL. For Doctrine 2.x, a legacy Logger class implements the SQLLogger interface to capture queries, including parameter binding and formatting. This allows users to monitor database activity regardless of their Doctrine version.
Clockwork/Support/Doctrine · high confidence
Added Monolog integration handlers for versions 1.x, 2.x, and 3.x
Clockwork now provides dedicated Monolog handlers that bridge Monolog logging to Clockwork's internal log instance. Separate handler classes are available for Monolog 1.x, 2.x, and 3.x to ensure compatibility across major versions. The Monolog 3.x handler specifically adapts to the new LogRecord object structure, extracting the level name via getName() to correctly map numeric log levels to Clockwork's logging system.
Clockwork/Support/Monolog · high confidence
Added N+1 query detection and configurable HTTP response body collection
The Eloquent data source now includes support for detecting duplicate (N+1) queries, which is disabled by default and warns users when the same model relation is loaded multiple times. Additionally, HTTP data sources now support collecting streamed response bodies and allow configuring a maximum collected response body size limit to prevent excessive memory usage.
Clockwork/DataSource/Concerns · high confidence
Added Slim 2 support middleware and log writer
This change introduces support for the legacy Slim 2 framework by adding the \ClockworkMiddleware\ and \ClockworkLogWriter\ classes. The middleware integrates Clockwork into the Slim 2 application lifecycle by registering the Clockwork service, replacing the default log writer to capture application logs, and handling requests to the \\_\_clockwork\ endpoint to retrieve stored request data. It also ensures that debug headers (such as \X-Clockwork-Id\ and \Server-Timing\) are added to responses when debug mode is enabled.
Clockwork/Support/Slim/Old · high confidence
Added Swift Mailer plugin to track sent emails in the Clockwork timeline
A new Swift Mailer plugin has been introduced that automatically records sent email events into the Clockwork timeline. This integration captures key details such as the sender, recipient, subject, and email headers for each message, allowing users to monitor email activity directly within their application's performance and debugging dashboard.
Clockwork/Support/Swift · high confidence
Added Twig Profiler support for Clockwork timeline
Clockwork now includes a new ProfilerClockworkDumper that converts Twig profiling data into rendered views timelines. This allows users to visualize Twig template rendering performance, including execution time and memory usage, directly within the Clockwork interface.
Clockwork/Support/Twig · high confidence
Added extensible authentication support for Clockwork
Clockwork now includes a new authentication system allowing users to secure access. The system is built around an \AuthenticatorInterface\ that enables user-extensible implementations. A \SimpleAuthenticator\ is provided by default, which validates access using a single plaintext password (hashed for storage and verified securely). Additionally, a \NullAuthenticator\ is included, which bypasses authentication entirely, useful for development or unsecured environments.
Clockwork/Authentication · high confidence
Added support for capturing Laravel Artisan console output
Clockwork now includes the ability to capture the output of Laravel Artisan commands, which is disabled by default. This feature is implemented via three new formatter classes (CapturingFormatter, CapturingLegacyFormatter, and CapturingOldFormatter) that wrap Symfony's output formatters to intercept and store formatted text, ensuring compatibility across Symfony 5.x, 6.x, and 7.x versions.
Clockwork/Support/Laravel/Console · high confidence
Clockwork 5.3.5 introduces request filtering, authentication, and new request types
The Clockwork library has been updated to version 5.3.5, introducing several new capabilities for debugging and monitoring. Users can now authenticate access to metadata via the new \AuthenticatorInterface\ (defaulting to \NullAuthenticator\), and configure collection and recording rules using the new \ShouldCollect\ and \ShouldRecord\ objects, which support closures and array-based options for filtering by errors, slow requests, or sampling. The library now supports resolving requests as specific types—\command\, \queue-job\, and \test\—with dedicated methods (\resolveAsCommand\, \resolveAsQueueJob\, \resolveAsTest\) to capture relevant metadata like exit codes, job payloads, and test assertions. Additionally, a \reset()\ method allows clearing collected data, and the main \Clockwork\ class exposes shortcut methods for accessing the log and timeline instances directly.
Clockwork · high confidence
Initial Clockwork support for Symfony via a new bundle
This change introduces a new Symfony bundle (ClockworkBundle) that integrates the Clockwork debugging tool with the Symfony framework. It registers a service container extension, factory, and support classes to wire Clockwork into Symfony's profiler, enabling the collection and display of request data, logs, and performance metrics. The bundle provides a web UI accessible via configurable routes (defaulting to 'clockwork'), supports optional authentication, and allows enabling/disabling Clockwork and its web interface via configuration.
Clockwork/Support/Symfony · high confidence
Initial Lumen integration with automatic middleware registration
Clockwork now supports Lumen applications. The integration includes a service provider that automatically registers the Clockwork middleware, defines REST API and web UI routes, and configures data sources. A dedicated middleware class handles request processing and termination, while a controller manages API endpoints and serves the web interface. The support class adapts Clockwork's core behavior to Lumen's application structure, including feature availability checks for database, queue, and Redis.
Clockwork/Support/Lumen · high confidence
New Laravel integration components and Guzzle stream support
This release introduces the core Laravel integration files, including the ClockworkServiceProvider, Middleware, Controller, and Support classes, which wire up data sources (database, cache, queue, HTTP client, etc.), register the 'clockwork:clean' artisan command, and handle request processing and web UI routing. It also adds a Guzzle stream decorator (ClockworkCapturingStream) for capturing HTTP response bodies and a Laravel 'clock()' helper function for logging messages.
Clockwork/Support/Laravel · high confidence
New SQL and Redis storage backends with unified search capabilities
Clockwork now supports storing request metadata in SQL databases (via PDO) and Redis (including clustered Redis), in addition to the existing file-based storage. These new backends allow users to persist metadata in more scalable or shared environments. All storage implementations now support a unified search interface, enabling users to filter requests by URI, controller, HTTP method, status code, duration, and type (including commands, queue jobs, and tests). The SQL storage uses a flexible schema with TEXT columns for complex data and supports lazy initialization, while Redis storage handles serialization and expiration natively.
Clockwork/Storage · high confidence
New helper classes for serialization, stack traces, and server timing
Added new helper classes in the Clockwork/Helpers directory to improve data handling and performance reporting. The Serializer class provides configurable normalization of objects and arrays, including recursion detection, blackboxing specific Laravel classes, and respecting \_\_debugInfo methods. The StackTrace and StackFrame classes offer a structured way to capture and manipulate stack traces, with support for filtering, skipping, and limiting frames, as well as fixing missing file/line info in call\_user\_func frames. The StackFilter class enables filtering stack frames by class, file, function, namespace, or vendor. Additionally, the ServerTiming helper generates Server-Timing headers with application, database, and timeline event metrics, defaulting to 10 events.
Clockwork/Helpers · high confidence
New request filtering and custom user data structures
The Clockwork/Request area introduces new classes to control data collection and enhance metadata. ShouldCollect and ShouldRecord now provide explicit filters for incoming requests, supporting on-demand profiling, sampling, URI-based allow/deny lists, and recording only errors or slow requests. IncomingRequest standardizes HTTP request data access. Additionally, UserData and UserDataItem classes allow adding custom data to requests, which can be displayed as counters or tables in the Clockwork interface.
Clockwork/Request · high confidence
New timeline event and timeline data structures
Added new Event and Timeline classes in the Clockwork/Request/Timeline namespace to represent individual timeline events and collections of time-based events. The Event class provides a fluent API for managing event start/end times, duration, and data, including a run method that executes a closure while tracking time. The Timeline class manages a collection of events, supporting creation, finding, merging, sorting, and finalization of events into an array format.
Clockwork/Request/Timeline · high confidence
New vanilla PHP integration with PSR-7 middleware and Web UI support
Clockwork now includes a dedicated integration for vanilla PHP applications, providing a \Clockwork\ class and a PSR-7 compatible \ClockworkMiddleware\ to automatically handle API requests and serve the Web UI. This addition introduces helper functions (like \clock()\), support for collecting console commands and queue jobs, and configurable features such as client metrics, toolbar display, and authentication. The integration defaults to enabling the toolbar and Web UI, with data collection restricted to local domains unless explicitly configured otherwise.
Clockwork/Support/Vanilla · high confidence
Behavioural changes
Comprehensive configuration options for Clockwork data collection in Laravel
The Laravel integration now exposes a detailed configuration file (clockwork.php) that allows users to granularly control which data sources are collected. Users can enable or disable features such as cache queries, database queries (including model actions and duplicate detection), HTTP requests (with options for raw data and streamed responses), events, logs, notifications, queue jobs, Redis commands, routes, and views. The configuration also introduces specific settings for request sampling, error-only collection, slow request thresholds, and on-demand profiling modes, giving developers fine-grained control over performance impact and data visibility.
Clockwork/Support/Laravel/config · high confidence
Improved Eloquent model name resolution for Laravel 4.2+
The Eloquent data source now correctly resolves the model class name for database queries in Laravel 4.2 and later versions. This is achieved by introducing two new scope classes, ResolveModelScope and ResolveModelLegacyScope, which implement the respective Laravel scope interfaces to capture the model class via get\_class() and pass it to the data source, ensuring accurate query metadata tracking.
Clockwork/Support/Laravel/Eloquent · high confidence
Moved Slim 3 middleware to legacy namespace
The Slim 3 middleware has been relocated to the Clockwork\\Support\\Slim\\Legacy namespace. This change isolates the legacy integration code, ensuring that existing Slim 3 applications continue to function while allowing the main Slim support area to focus on newer versions.
Clockwork/Support/Slim/Legacy · high confidence
New data source architecture with configurable feature collection
The data source layer has been restructured to support a new 'features' configuration system, replacing the previous 'filter' setting. This allows specific data collection capabilities—such as database queries, cache stats, and views—to be enabled or disabled independently, with disabled features incurring no performance impact. The base DataSource class now provides a unified filtering mechanism, while specific data sources like Eloquent, Laravel Cache, and Laravel Redis support granular collection options (e.g., collecting only stats vs. full query details). Additionally, new data sources have been introduced for Doctrine (DBALDataSource, DoctrineDataSource) and Guzzle HTTP client (GuzzleDataSource, LaravelHttpClientDataSource), expanding the tool's ability to monitor database interactions and external HTTP requests.
Clockwork/DataSource · high confidence
Resolved Laravel view names in stack traces
Stack traces now display the original source path of Laravel views instead of their compiled temporary paths, improving readability when debugging view-related issues.
Clockwork/Helpers/Concerns · high confidence
Secure asset serving with correct MIME types
The Clockwork Web UI now uses a dedicated helper class to serve static assets, ensuring that files like CSS, JavaScript, JSON, and PNG are served with their correct MIME types. This change also includes path resolution logic that prevents directory traversal attacks by ensuring assets are only served from the designated public directory.
Clockwork/Web · high confidence
Updated Clockwork Web UI to Vue 3.5.13
The Clockwork Web interface has been updated to use Vue 3.5.13. This upgrade brings the latest reactivity system, runtime-core, and shared utilities from the Vue framework, ensuring compatibility with the latest browser standards and providing performance improvements and bug fixes inherent to this Vue version.
Clockwork/Web/public · high confidence
Test coverage
Added PHPUnit extension and trait for collecting test execution data in Laravel
This change introduces two new files in the Laravel test support area: \ClockworkExtension.php\ and \UsesClockwork.php\. The \ClockworkExtension\ is a PHPUnit 10+ compatible extension that registers event subscribers to capture test lifecycle events (passed, failed, error, etc.) and assertion details. The \UsesClockwork\ trait provides a legacy-compatible mechanism for older PHPUnit versions or specific setups, allowing test cases to easily include Clockwork by using the trait and calling \setUpClockwork()\. Both components work together to collect executed tests, their status, and the assertions made during execution, storing this data via the Clockwork support layer when test collection is enabled.
Clockwork/Support/Laravel/Tests · high confidence
Dependencies
Initial release of Clockwork PHP dev tools
This entry introduces the Clockwork package, a set of PHP developer tools for debugging, profiling, and logging that integrates with Laravel, Lumen, and Slim. The package requires PHP 7.1 or higher and the ext-json extension. It supports metadata storage via various database extensions (PDO, Redis) and includes a vanilla PSR-compatible middleware for zero-configuration setup. Laravel users benefit from automatic package discovery, with the service provider and facade registered via composer.json extra configuration.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 51.
Lenses
- Code Health 96
- Architecture 95
- Maturity 50
- Readiness 36
- Security 100
- Accessibility 57
Changes since last survey
- 300 commits — 225 feature/other, 75 fixes
By area
- Clockwork/Support — 74 commits
- Clockwork/DataSource — 66 commits
- (repo) — 59 commits
- Clockwork/Storage — 41 commits
- (root) — 37 commits
- Clockwork/Request — 10 commits
- Clockwork/Web — 7 commits
- Clockwork/Clockwork.php — 3 commits
- Clockwork/Helpers — 3 commits
Notable commits
- fix: FileStorage - fixed compatibility with old PHP versions when writing new record to the index file.
- fix: Fix Call to a member function getBody() on null
- fix: Fix PHP 8.1+ deprecation warnings for null parameters to internal functions
- fix: Fix PHP 8.2 dynamic property deprecated
- fix: Fix PHP 8.2 dynamic property deprecated
- fix: Fix Symfony 6 compatibility
- fix: Fix bug in SQL-based search
- fix: Fix bug in SQL-based search
- fix: Fix bug in retrieving previous requests
- fix: Fix bug in retrieving previous requests
- fix: Fix classname Class "Clockwork\DataSource\Logger" not found
- fix: Fix code style.
- fix: Fix code style.
- fix: Fix for Slim and custom basepath
- fix: Fix issues with using clustered redis
- fix: Fix issues with using clustered redis
- fix: Fixed dynamic property declaration in GuzzleDataSource.
- fix: Fixed incompatibility with older Laravel versions.
- fix: Fixed incompatibility with older Laravel versions.
- fix: Fixed white-space.
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
itsgoingd/clockwork was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 88b790affc24ddaf21446b8ecfe6895449168548 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.