{"id":28163888,"url":"https://github.com/ctohm/laravel-request-profiler","last_synced_at":"2026-02-13T17:32:02.919Z","repository":{"id":270508890,"uuid":"910592092","full_name":"ctohm/laravel-request-profiler","owner":"ctohm","description":"Minimalistinc request profiler to diagnose bottlenecks in laravel","archived":false,"fork":false,"pushed_at":"2025-01-24T11:33:18.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T19:45:40.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctohm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-31T18:31:41.000Z","updated_at":"2025-01-24T11:33:13.000Z","dependencies_parsed_at":"2024-12-31T19:29:18.705Z","dependency_job_id":"404e3f6c-e1fa-4dc5-a68a-a326b2ad519e","html_url":"https://github.com/ctohm/laravel-request-profiler","commit_stats":null,"previous_names":["ctohm/laravel-request-profiler"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ctohm/laravel-request-profiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctohm%2Flaravel-request-profiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctohm%2Flaravel-request-profiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctohm%2Flaravel-request-profiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctohm%2Flaravel-request-profiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctohm","download_url":"https://codeload.github.com/ctohm/laravel-request-profiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctohm%2Flaravel-request-profiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29413389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-05-15T11:14:42.424Z","updated_at":"2026-02-13T17:32:02.897Z","avatar_url":"https://github.com/ctohm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Laravel Request Profiler\n\n![laravel-timings](https://github.com/user-attachments/assets/9ea1f374-8db2-4deb-8522-de5d872b3bd9)\n\nLaravel Request Profiles is a package that will enable putting marks in your code to identify your application\nbottlenecks.\n\nOnce installed, publish the config file by doing\n\n```sh\nphp artisan vendor:publish --provider=\"CTOhm\\LaravelRequestProfiler\\Providers\\TimingsServiceProvider\" --tag=config\n```\n\nThe service provider will autoregister a singleton `app('timings')` that you can use to push timing marks into a\ndedicated message bag. We suggest starting up the timings messagebag as early as possible in the request lifecycle. For\nexample, in the `TrustProxies` middleware. In the same middleware you can call the method to wrap up the timings\nfor the current request when returning the output of `$next($request)`.\n\n```php\n    public function handle(Request $request, Closure $next)\n    {\n        // jumpstart the profiler at the beggining of the middleware \n        app('timings')-\u003eenabledIf(config('laravel-request-profiler.collect_timings'));\n        $request-\u003eheaders-\u003eset('Request-Id', (string) str()-\u003euuid());\n        app('timings')-\u003epushTiming();\n\n        // here goes the original content for this middleware\n        $request::setTrustedProxies([], $this-\u003egetTrustedHeaderNames()); // Reset trusted proxies between requests\n        $this-\u003esetTrustedProxyIpAddresses($request);\n\n        // tap into the final output to wrap up the timings process\n        return tap($next($request), function () use ($request) {\n            app('timings')-\u003epushTiming();\n            app('timings')-\u003eprocess_timings($request);\n        });\n    }\n```\n\nEvery time you use the `app('timings')-\u003epushTiming()` statement, a new mark will be recorded by the profiler, as if it was a breakpoint. In the image above, you can see the final output:\n\n  - The upper section shows the spl object id of the request and its uuid, as well as the requested path. \n  - The lower section shows the file, the line where `pushTiming` was called, the incremental timing from the last call and the total time up to that point.\n  - Finally, the total ovewall time is shown.\n\nInspect the collected timings by doing\n\n```bash\ntail -f storage/logs/timings.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctohm%2Flaravel-request-profiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctohm%2Flaravel-request-profiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctohm%2Flaravel-request-profiler/lists"}