{"id":50755970,"url":"https://github.com/willitscale/statsd","last_synced_at":"2026-06-11T05:01:18.552Z","repository":{"id":346585486,"uuid":"1190640651","full_name":"willitscale/statsd","owner":"willitscale","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-24T13:39:28.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T17:42:32.125Z","etag":null,"topics":[],"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/willitscale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2026-03-24T13:33:49.000Z","updated_at":"2026-03-24T13:39:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/willitscale/statsd","commit_stats":null,"previous_names":["willitscale/statsd"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/willitscale/statsd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2Fstatsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2Fstatsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2Fstatsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2Fstatsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willitscale","download_url":"https://codeload.github.com/willitscale/statsd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2Fstatsd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34183109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2026-06-11T05:01:17.274Z","updated_at":"2026-06-11T05:01:18.538Z","avatar_url":"https://github.com/willitscale.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# statsd-php\n\nA PHP client library for the statistics daemon ([statsd](https://github.com/etsy/statsd)) intended to send metrics from PHP applications.\n\n[![Build Status](https://secure.travis-ci.org/domnikl/statsd-php.png?branch=master)](http://travis-ci.org/domnikl/statsd-php)\n\n## Installation\n\nThe best way to install statsd-php is to use Composer and add the following to your project's `composer.json` file:\n\n```javascript\n{\n    \"require\": {\n        \"domnikl/statsd\": \"~2.0\"\n    }\n}\n```\n\n## Usage\n\n```php\n\u003c?php\n$connection = new \\Domnikl\\Statsd\\Connection\\UdpSocket('localhost', 8125);\n$statsd = new \\Domnikl\\Statsd\\Client($connection, \"test.namespace\");\n\n// the global namespace is prepended to every key (optional)\n$statsd-\u003esetNamespace(\"test\");\n\n// simple counts\n$statsd-\u003eincrement(\"foo.bar\");\n$statsd-\u003edecrement(\"foo.bar\");\n$statsd-\u003ecount(\"foo.bar\", 1000);\n```\n\nWhen establishing the connection to statsd and sending metrics, errors will be suppressed to prevent your application from crashing.\n\nIf you run statsd in TCP mode, there is also a `\\Domnikl\\Statsd\\Connection\\TcpSocket` adapter that works like the `UdpSocket` except that it throws a `\\Domnikl\\Statsd\\Connection\\TcpSocketException` if no connection could be established.\nPlease consider that unlike UDP, TCP is used for reliable networks and therefor exceptions (and errors) will not be suppressed in TCP mode.\n\n### [Timings](https://github.com/etsy/statsd/blob/master/docs/metric_types.md#timing)\n\n```php\n\u003c?php\n// timings\n$statsd-\u003etiming(\"foo.bar\", 320);\n$statsd-\u003etime(\"foo.bar.bla\", function() {\n    // code to be measured goes here ...\n});\n\n// more complex timings can be handled with startTiming() and endTiming()\n$statsd-\u003estartTiming(\"foo.bar\");\n// more complex code here ...\n$statsd-\u003eendTiming(\"foo.bar\");\n```\n\n### Memory profiling\n\n```php\n\u003c?php\n// memory profiling\n$statsd-\u003estartMemoryProfile('memory.foo');\n// some complex code goes here ...\n$statsd-\u003eendMemoryProfile('memory.foo');\n\n// report peak usage\n$statsd-\u003ememory('foo.memory_peak_usage');\n```\n\n### [Gauges](https://github.com/etsy/statsd/blob/master/docs/metric_types.md#gauges)\n\nstatsd supports gauges, arbitrary values which can be recorded. \n\nThis method accepts both absolute (3) and delta (+11) values. \n\n*NOTE:* Negative values are treated as delta values, not absolute.\n\n```php\n\u003c?php\n// Absolute value\n$statsd-\u003egauge('foobar', 3);\n\n// Pass delta values as a string. \n// Accepts both positive (+11) and negative (-4) delta values.\n$statsd-\u003egauge('foobar', '+11'); \n```\n\n### [Sets](https://github.com/etsy/statsd/blob/master/docs/metric_types.md#sets)\n\nstatsd supports sets, so you can view the uniqueness of a given value.\n\n```php\n\u003c?php\n$statsd-\u003eset('userId', 1234);\n```\n\n### disabling sending of metrics\n\nTo disable sending any metrics to the statsd server, you can use the `Domnikl\\Statsd\\Connection\\Blackhole` connection\n\u2028class instead of the default socket abstraction. This may be incredibly useful for feature flags. Another options is\nto use `Domnikl\\Statsd\\Connection\\InMemory` connection class, that will collect your messages but won't actually send them.\n\n## Authors\n\nOriginal author: Dominik Liebler \u003cliebler.dominik@gmail.com\u003e\nSeveral other [contributors](https://github.com/domnikl/statsd-php/graphs/contributors) - Thank you!\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2016 Dominik Liebler\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillitscale%2Fstatsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillitscale%2Fstatsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillitscale%2Fstatsd/lists"}