定制 darkflib/php-statsd 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

darkflib/php-statsd

Composer 安装命令:

composer require darkflib/php-statsd

包简介

Statsd library for PHP

README 文档

README

This is an extremely simple PHP statsd client and CI spark.

Installation

Use composer...

Usage

Counting

To count things:

$stats = new PhpStatsD\StatsD();
$stats->counting('numpoints', 123);

Guages

$stats = new PhpStatsD\StatsD();
$stats->gauge('coffee_left', 3);

Timing

Record timings:

$stats = new PhpStatsD\StatsD();
$stats->timing('timething', 123);

Time Block

And a convenience mechanism for timing:

$stats = new PhpStatsD\StatsD();
$stats->time_this('timething', function() {
    sleep(1);
});

Configuration

Host and Port

$stats = new PhpStatsD\StatsD('localhost', 7000); // default localhost:8125

Sample Rate

Any of the methods descriped in the usage section can take an optional third argument $rate, which is the sample rate:

$stats = new StatsD();
$stats->counting('numpoints', 123, 0.1);

As a CodeIgniter library

$this->load->library('statsd');
$this->statsd->counting('numpoints', 123);

Author

John Crepezzi - john.crepezzi@gmail.com

License

(The MIT License)

Copyright © 2012 John Crepezzi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. MIT License. See attached LICENSE

统计信息

  • 总下载量: 21.39k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固