定制 squinones/woof 二次开发

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

邮箱: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

squinones/woof 适用场景与选型建议

squinones/woof 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.02k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2014 年 06 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「logging」 「statsd」 「profiling」 「DataDog」 「devops」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 squinones/woof 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 squinones/woof 我们能提供哪些服务?
定制开发 / 二次开发

基于 squinones/woof 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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