{"id":36281030,"url":"https://github.com/playwright-php/performance","last_synced_at":"2026-01-11T09:04:29.735Z","repository":{"id":323168624,"uuid":"1074966940","full_name":"playwright-php/performance","owner":"playwright-php","description":"Measure Core Web Vitals and browser performance timings from PHP","archived":false,"fork":false,"pushed_at":"2025-11-08T13:39:42.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-08T15:19:16.657Z","etag":null,"topics":["browser","core-web-vitals","network","performance","php-browser","playwright","playwright-php","testing","timing","web-performance"],"latest_commit_sha":null,"homepage":"https://playwright-php.dev","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/playwright-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["smnandre"]}},"created_at":"2025-10-12T20:13:21.000Z","updated_at":"2025-11-08T13:39:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/playwright-php/performance","commit_stats":null,"previous_names":["playwright-php/performance"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/playwright-php/performance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-php%2Fperformance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-php%2Fperformance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-php%2Fperformance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-php%2Fperformance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/playwright-php","download_url":"https://codeload.github.com/playwright-php/performance/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-php%2Fperformance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28298878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T08:21:30.231Z","status":"ssl_error","status_checked_at":"2026-01-11T08:21:26.882Z","response_time":60,"last_error":"SSL_read: 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":["browser","core-web-vitals","network","performance","php-browser","playwright","playwright-php","testing","timing","web-performance"],"created_at":"2026-01-11T09:04:29.611Z","updated_at":"2026-01-11T09:04:29.722Z","avatar_url":"https://github.com/playwright-php.png","language":"PHP","funding_links":["https://github.com/sponsors/smnandre"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/playwright-php/.github/raw/main/profile/playwright-php.png\" alt=\"Playwright PHP\" /\u003e\n\n\u0026nbsp; ![PHP Version](https://img.shields.io/badge/PHP-8.2-05971B?labelColor=09161E\u0026color=1D8D23\u0026logoColor=FFFFFF)\n\u0026nbsp; ![CI](https://img.shields.io/github/actions/workflow/status/playwright-php/performance/CI.yaml?branch=main\u0026label=Tests\u0026color=1D8D23\u0026labelColor=09161E\u0026logoColor=FFFFFF)\n\u0026nbsp; ![Release](https://img.shields.io/github/v/release/playwright-php/performance?label=Stable\u0026labelColor=09161E\u0026color=1D8D23\u0026logoColor=FFFFFF)\n\u0026nbsp; ![License](https://img.shields.io/github/license/playwright-php/performance?label=License\u0026labelColor=09161E\u0026color=1D8D23\u0026logoColor=FFFFFF)\n\n\u003c/div\u003e\n\n# Playwright PHP - Performance\n\n\u003e [!IMPORTANT]  \n\u003e This package is **experimental**. Its API may still change before the upcoming `1.0` release.  \n\u003e  \n\u003e Curious or interested? Try it out, [share your feedback](https://github.com/playwright-php/performance/issues), or ideas!\n\nThe Performance package helps you inspect how a page behaves in a real browser \nby extracting Core Web Vitals and network timing data with a single API. \n\n## Features\n\n- Capture all Core Web Vitals directly from the browser with resilient fallbacks:\n    - **LCP** (Largest Contentful Paint) - Loading performance\n    - **FCP** (First Contentful Paint) - Initial render timing\n    - **CLS** (Cumulative Layout Shift) - Visual stability\n    - **INP** (Interaction to Next Paint) - Responsiveness (Core Web Vital as of 2024)\n    - **FID** (First Input Delay) - Input responsiveness\n    - **TTFB** (Time to First Byte) - Server response time\n    - **TBT** (Total Blocking Time) - Main thread blocking\n- Collect resource timing entries and expose them as value objects for downstream analysis.\n\n## Getting Started\n\n### Installation\n\n```bash\ncomposer require --dev playwright-php/performance\n```\n\n## Usage\n\n```php\nuse Playwright\\Performance\\Monitor\\PerformanceMonitor;\nuse Playwright\\Playwright;\n\n$browser = Playwright::chromium();\n$page = $browser-\u003enewPage();\n\n$monitor = new PerformanceMonitor($page);\n$monitor-\u003enavigate('https://example.com');\n\n$resources = $monitor-\u003ecollectResourceMetrics();\n\n// Core Web Vitals\n$vitals = $monitor-\u003ecollectCoreWebVitals();\n\n// Resource Metrics\n$resources = $monitor-\u003ecollectResourceMetrics();\n\n$browser-\u003eclose();\n```\n\n### Core Web Vitals\n\n```php\n// ...\n// $vitals = $monitor-\u003ecollectCoreWebVitals();\n\necho $vitals-\u003elcp;   // Largest Contentful Paint (ms)\necho $vitals-\u003efcp;   // First Contentful Paint (ms)\necho $vitals-\u003ecls;   // Cumulative Layout Shift\necho $vitals-\u003einp;   // Interaction to Next Paint (ms)\necho $vitals-\u003efid;   // First Input Delay\necho $vitals-\u003ettfb;  // Time to First Byte (ms)\necho $vitals-\u003etbt;   // Total Blocking Time (ms)\n```\n\n### Resources Loaded\n\n```php\n// ...\n// $resources = $monitor-\u003ecollectResourceMetrics();\n\nforeach ($resources as $resource) {\n    echo $resource-\u003etoArray();\n}\n```\n\n### Format Results\n\n```php\nuse Playwright\\Performance\\Reporter\\JsonReporter;\nuse Playwright\\Performance\\Reporter\\MarkdownReporter;\n\n// ...\n// $resources = $monitor-\u003ecollectResourceMetrics();\n\n// JSON (default)\n$reporter = new JsonReporter();\nfile_put_contents('report.json', $reporter-\u003egenerate($vitals, $resources));\n\n// Markdown\n$reporter = new MarkdownReporter();\nfile_put_contents('report.md', $reporter-\u003egenerate($vitals, $resources));\n```\n\n## Testing\n\nUse `MockPerformanceMonitor` to test your code without launching a browser:\n\n```php\nuse Playwright\\Performance\\Monitor\\MockPerformanceMonitor;\nuse Playwright\\Performance\\Metrics\\CoreWebVitals;\n\nclass MyServiceTest extends TestCase\n{\n    public function testPerformanceCheck(): void\n    {\n        $mock = new MockPerformanceMonitor();\n\n        // Define expected values (optional)\n        $mock-\u003esetCoreWebVitals(new CoreWebVitals(100.0, 50.0, 0.01, 0.0, 0.0, 80.0, 0.0));\n        $service = new MyService($mock);\n        \n        // No real browser is launched here\n        $service-\u003eanalyzePerformance('https://example.com');\n    }\n}\n```\n\nThe package also includes a PHPUnit trait with performance assertions. See the \nfull documentation for details.\n\n## License\n\nThis package is released by the [Playwright PHP](https://playwright-php.dev) \nproject under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaywright-php%2Fperformance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaywright-php%2Fperformance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaywright-php%2Fperformance/lists"}