squinones/woof 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

squinones/woof

Composer 安装命令:

composer require squinones/woof

包简介

Woof - DataDogStatsD Client

README 文档

README

#Woof - A simple DataDogStatsD Client for PHP 5.4+

Build Status

Woof is a simple PHP client for the DataDog agent, used to send metrics information to DataDog.

Woof uses non-blocking UDP connections to send data with a minimal risk to application perfomance and is deeply inspired by Alex Corsley's library

##Usage (Shamelessly cribbed from here: http://docs.datadoghq.com/guides/dogstatsd/)

###Creating a client

// Create a new client (localhost:8125 is the default)
$woof = new Woof("localhost", 8125);

###Gauges Gauges measure the value of a particular thing at a particular time, like the amount of fuel in a car’s gas tank or the number of users connected to a system.

$woof->gauge("gas_tank.level", 0.75);
$woof->gauge("users.active", 1001);

###Counters Counters track how many times something happened per second, like the number of database requests or page views.

$woof->increment("database.query.count");
$woof->increment("page_view.count", 10);
$woof->decrement("available.threads");

###Histograms Histograms track the statistical distribution of a set of values, like the duration of a number of database queries or the size of files uploaded by users. Each histogram will track the average, the minimum, the maximum, the median and the 95th percentile.

$woof->histogram("database.query.time", 0.5);
$woof->histogram("file.upload.size", filesize($file));

###Sets Sets are used to count the number of unique elements in a group. If you want to track the number of unique visitor to your site, sets are a great way to do that.

$woof->set("users.uniques", $user->getId());

###Timers StatsD only supports histograms for timing, not generic values (like the size of uploaded files or the number of rows returned from a query). Timers are essentially a special case of histograms, so they are treated in the same manner by DogStatsD for backwards compatibility.

$woof->timer("response.time", 200);

###Tags Tags are a Datadog specific extension to StatsD. They allow you to tag a metric with a dimension that’s meaningful to you and slice and dice along that dimension in your graphs. For example, if you wanted to measure the performance of two video rendering algorithms, you could tag the rendering time metric with the version of the algorithm you used.

$woof->increment("api.requests", 1, ["api"]);               // adds #api tag
$woof->increment("api.errors", 1, ["error_code" => 400]);   // adds #error_code:400 tag

###Sample Rates The overhead of sending UDP packets can be too great for some performance intensive code paths. To work around this, StatsD clients support sampling, that is to say, only sending metrics a percentage of the time. For example:

$woof->histogram("my.histogram", 1, [], 0.5);

will only be sent to the server about half of the time, but it will be multipled by the sample rate to provide an estimate of the real data.

###Events Not currently supported

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固