{"id":13395889,"url":"https://github.com/itsgoingd/clockwork","last_synced_at":"2025-05-13T11:06:17.387Z","repository":{"id":9081188,"uuid":"10855394","full_name":"itsgoingd/clockwork","owner":"itsgoingd","description":"Clockwork - php dev tools in your browser - server-side component","archived":false,"fork":false,"pushed_at":"2025-04-20T14:53:44.000Z","size":12720,"stargazers_count":5823,"open_issues_count":31,"forks_count":322,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-05-13T11:05:59.112Z","etag":null,"topics":["clockwork","debugging","devtools","laravel","logging","php","profiling"],"latest_commit_sha":null,"homepage":"https://underground.works/clockwork","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itsgoingd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"itsgoingd"}},"created_at":"2013-06-21T23:57:05.000Z","updated_at":"2025-05-12T17:58:47.000Z","dependencies_parsed_at":"2023-02-15T22:45:57.156Z","dependency_job_id":"869ff8ab-31c0-422b-a59f-8af85fbc5368","html_url":"https://github.com/itsgoingd/clockwork","commit_stats":{"total_commits":739,"total_committers":100,"mean_commits":7.39,"dds":0.503382949932341,"last_synced_commit":"954d18ef6b0fa01190769341e09e981303a7c17c"},"previous_names":[],"tags_count":119,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgoingd%2Fclockwork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgoingd%2Fclockwork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgoingd%2Fclockwork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgoingd%2Fclockwork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsgoingd","download_url":"https://codeload.github.com/itsgoingd/clockwork/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253929362,"owners_count":21985802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clockwork","debugging","devtools","laravel","logging","php","profiling"],"created_at":"2024-07-30T18:00:35.052Z","updated_at":"2025-05-13T11:06:17.361Z","avatar_url":"https://github.com/itsgoingd.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg width=\"300px\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/title.png\"\u003e\n\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/screenshot.png\"\u003e\n\u003c/p\u003e\n\n\u003e Clockwork is a development tool for PHP available right in your browser. Clockwork gives you an insight into your application runtime - including request data, performance metrics, log entries, database queries, cache queries, redis commands, dispatched events, queued jobs, rendered views and more - for HTTP requests, commands, queue jobs and tests.\n\n\u003e *This repository contains the server-side component of Clockwork.*\n\n\u003e Check out on the [Clockwork website](https://underground.works/clockwork) for details.\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://underground.works/clockwork\"\u003e\n\t\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/features-1.png\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://underground.works/clockwork\"\u003e\n\t\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/features-2.png\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://underground.works/clockwork\"\u003e\n\t\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/features-3.png\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://underground.works/clockwork\"\u003e\n\t\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/features-4.png\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://underground.works/clockwork\"\u003e\n\t\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/features-5.png\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://underground.works/clockwork\"\u003e\n\t\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/features-6.png\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://underground.works/clockwork\"\u003e\n\t\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/features-7.png\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://underground.works/clockwork\"\u003e\n\t\t\u003cimg width=\"100%\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/features-8.png\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n### Installation\n\nInstall the Clockwork library via [Composer](https://getcomposer.org/).\n\n```\ncomposer require itsgoingd/clockwork\n```\n\nCongratulations, you are done! To enable more features like commands or queue jobs profiling, publish the configuration file via the `vendor:publish` Artisan command.\n\n**Note:** If you are using the Laravel route cache, you will need to refresh it using the route:cache Artisan command.\n\nRead [full installation instructions](https://underground.works/clockwork/#docs-installation) on the Clockwork website.\n\n### Features\n\n#### Collecting data\n\nThe Clockwork server-side component collects and stores data about your application.\n\nClockwork is only active when your app is in debug mode by default. You can choose to explicitly enable or disable Clockwork, or even set Clockwork to always collect data without exposing them for further analysis.\n\nWe collect a whole bunch of useful data by default, but you can enable more features or disable features you don't need in the config file.\n\nSome features might allow for advanced options, eg. for database queries you can set a slow query threshold or enable detecting of duplicate (N+1) queries. Check out the config file to see all what Clockwork can do.\n\nThere are several options that allow you to choose for which requests Clockwork is active.\n\nOn-demand mode will collect data only when Clockwork app is open. You can even specify a secret to be set in the app settings to collect request. Errors only will record only requests ending with 4xx and 5xx responses. Slow only will collect only requests with responses above the set slow threshold. You can also filter the collected and recorded requests by a custom closure. CORS pre-flight requests will not be collected by default.\n\nNew in Clockwork 4.1, artisan commands, queue jobs and tests can now also be collected, you need to enable this in the config file.\n\nClockwork also collects stack traces for data like log messages or database queries. Last 10 frames of the trace are collected by default. You can change the frames limit or disable this feature in the configuration file.\n\n#### Viewing data\n\n##### Web interface\n\nVisit `/clockwork` route to view and interact with the collected data.\n\nThe app will show all executed requests, which is useful when the request is not made by browser, but for example a mobile application you are developing an API for.\n\n##### Browser extension\n\nA browser dev tools extension is also available for Chrome and Firefox:\n\n- [Chrome Web Store](https://chrome.google.com/webstore/detail/clockwork/dmggabnehkmmfmdffgajcflpdjlnoemp)\n- [Firefox Addons](https://addons.mozilla.org/en-US/firefox/addon/clockwork-dev-tools/)\n\n##### Toolbar\n\nClockwork now gives you an option to show basic request information in the form of a toolbar in your app.\n\nThe toolbar is fully rendered client-side and requires installing a tiny javascript library.\n\n[Learn more](https://underground.works/clockwork/#docs-viewing-data) on the Clockwork website.\n\n#### Logging\n\nYou can log any variable via the clock() helper, from a simple string to an array or object, even multiple values:\n\n```php\nclock(User::first(), auth()-\u003euser(), $username)\n```\n\nThe `clock()` helper function returns it's first argument, so you can easily add inline debugging statements to your code:\n\n```php\nUser::create(clock($request-\u003eall()))\n```\n\nIf you want to specify a log level, you can use the long-form call:\n\n```php\nclock()-\u003einfo(\"User {$username} logged in!\")\n```\n\n#### Timeline\n\nTimeline gives you a visual representation of your application runtime.\n\nTo add an event to the timeline - start it with a description, execute the tracked code and finish the event. A fluent api is available to further configure the event.\n\n```php\n// using timeline api with begin/end and fluent configuration\nclock()-\u003eevent('Importing tweets')-\u003ecolor('purple')-\u003ebegin();\n    ...\nclock()-\u003eevent('Importing tweets')-\u003eend();\n```\n\nAlternatively you can execute the tracked code block as a closure. You can also choose to use an array based configuration instead of the fluent api.\n\n```php\n// using timeline api with run and array-based configuration\nclock()-\u003eevent('Updating cache', [ 'color' =\u003e 'green' ])-\u003erun(function () {\n    ...\n});\n```\n\nRead more about available features on the [Clockwork website](https://underground.works/clockwork).\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://underground.works\"\u003e\n\t\t\u003cimg width=\"150px\" src=\"https://github.com/itsgoingd/clockwork/raw/master/.github/assets/footer.png\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/itsgoingd"],"categories":["Popular Packages","Paquetes utiles","PHP","Developer \u0026 Debugging Tools","后端开发框架及项目","调试和性能( Debugging and Profiling )","类库","Development","Debugging \u0026 Performance"],"sub_categories":["PHP开发","调试工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsgoingd%2Fclockwork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsgoingd%2Fclockwork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsgoingd%2Fclockwork/lists"}