承接 phperf/percentiller 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

phperf/percentiller

最新稳定版本:v1.0

Composer 安装命令:

composer require phperf/percentiller

包简介

Streaming clusterized stats collector.

README 文档

README

Build Status Scrutinizer Code Quality

Percentiller is a PHP class for capturing and analyzing data distribution. Lightweight on CPU and memory consumption. Approximates percentiles bucketing the data.

Installation

composer install phperf/percentiller

Usage

$stats = new \Phperf\Percentiller();

// approximation level, more buckets - higher distribution definition for more CPU and memory
$stats->maxBuckets = 10;

// capture values and meta for 5 items with lowest values
$stats->captureBottomItems = 5;

// capture values and meta for 3 items with highest values
$stats->captureTopItems = 3;

.......

// somewhere in data streamer/iterator, replace $event with your data element
$stats->add($event->getResponseTime(), $event->getQueryInfo());

.......

// statistics retrieval

// 95% events had response time not greater than:
$stats->bottomPercentile(0.95);

// 10% events took longer or equal to:
$stats->topPercentile(0.1);

// get information on slowest events
$stats->getTopMetas();

// get information on slowest events
$stats->getBottomMetas();

// iterate through distribution
foreach ($stats->buckets as $bucket) {
    print_r($bucket);
    /*
    Array
    (
        [0] => 41.558                       // minival value
        [1] => 50.95                        // maximal value
        [2] => 137                          // count
        [3] => Array                        // sample meta
            (
                [somedata] => somevalue
            )

    )
    */
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-09-16