{"id":24624867,"url":"https://github.com/agencypmg/queue-profiling","last_synced_at":"2025-10-28T11:11:31.289Z","repository":{"id":57042990,"uuid":"66769270","full_name":"AgencyPMG/queue-profiling","owner":"AgencyPMG","description":null,"archived":false,"fork":false,"pushed_at":"2016-08-28T16:16:00.000Z","size":11,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-01-25T04:11:53.718Z","etag":null,"topics":["php","pmg-queue","pmg-queue-driver","queue"],"latest_commit_sha":null,"homepage":null,"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/AgencyPMG.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}},"created_at":"2016-08-28T13:20:38.000Z","updated_at":"2016-08-28T13:20:59.000Z","dependencies_parsed_at":"2022-08-23T23:40:22.490Z","dependency_job_id":null,"html_url":"https://github.com/AgencyPMG/queue-profiling","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgencyPMG%2Fqueue-profiling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgencyPMG%2Fqueue-profiling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgencyPMG%2Fqueue-profiling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgencyPMG%2Fqueue-profiling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgencyPMG","download_url":"https://codeload.github.com/AgencyPMG/queue-profiling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244382632,"owners_count":20443871,"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":["php","pmg-queue","pmg-queue-driver","queue"],"created_at":"2025-01-25T04:11:59.189Z","updated_at":"2025-10-28T11:11:26.270Z","avatar_url":"https://github.com/AgencyPMG.png","language":"PHP","readme":"# Queue Profiling\n\nProvides a `ProfilingConsumer` and set of handler decorators that can profile\nmessages once or while the queue is running via `SIGUSR1` (or other) posix\nsignals.\n\n## Usage\n\n### Pick an appropriate handler for your setup.\n\n- `PMG\\Queue\\Handler\\BlackfireProfilingHandler` - Profile with [blackfire.io](https://blackfire.io/)\n\nAll profiling handlers are [decorators](https://en.wikipedia.org/wiki/Decorator_pattern),\nso you'll create a real message handler and decorate it with the profiling\nhandler.\n\n```php\nuse PMG\\Queue\\Message;\nuse PMG\\Queue\\ProfilingConsumer;\nuse PMG\\Queue\\Handler\\CallableHandler;\nuse PMG\\Queue\\Handler\\BlackfireProfilingHandler;\n\n$realHandler = new CallableHandler(function (Message $message) {\n    // do stuff\n});\n\n$profilingHandler = BlackfireProfilingHandler::createDefault($realHandler);\n```\n\nIf you plan on forking new processes to handle messages with\n`PcntlForkingHandler`, decorate the profiling handler with it.\n\n```php\nuse PMG\\Queue\\Handler\\PcntlForkingHandler;\n\n$forkingHandler = new PcntlForkingHandler($profilingHandler);\n```\n\n### Instantiate a Consumer Like Normal\n\n```php\n\nuse PMG\\Queue\\ProfilingConsumer\n\n$consumer = new ProfilingConsumer($driver, $profilingHandler);\n```\n\n### Enable or Disable Profiling or Let the Signal Handlers Take Care of It\n\n\n```php\n// let the signal handler do their thing(s)\n$consumer-\u003erun('SomeQueue');\n\n// or enable/disable profiling manually\n$consumer-\u003eenableProfiling();\n$consumer-\u003eonce('SomeQueue');\n\n$consumer-\u003edisableProfiling();\n$consumer-\u003eonce('SomeQueue');\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagencypmg%2Fqueue-profiling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagencypmg%2Fqueue-profiling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagencypmg%2Fqueue-profiling/lists"}