renanbr/telltale

有助于提升应用程序性能的统计数据

dev-master / 1.0.x-dev 2013-09-20 18:30 UTC

This package is auto-updated.

Last update: 2024-09-05 19:01:48 UTC


README

Build Status Dependency Status

有助于提升应用程序性能的统计数据。

Telltale 分析当前执行情况,并提供有关应用程序中潜在瓶颈的信息。分析由 代理 执行。输出报告将自动发送到浏览器控制台。可用的 代理

  • 内存峰值;
  • 关键路径;
  • 最慢的调用;
  • 内存使用调用。

使用方法

<?php

use Telltale\Telltale;
use Telltale\Agent\MemoryPeakAgent;
use Telltale\Agent\CriticalPathAgent;
use Telltale\Agent\SlowestCallsAgent;
use Telltale\Agent\MemoryUsageCallsAgent;

// create an analyser
$telltale = new Telltale();
$telltale->pushAgent(new MemoryPeakAgent());
$telltale->pushAgent(new CriticalPathAgent());
$telltale->pushAgent(new SlowestCallsAgent());
$telltale->pushAgent(new MemoryUsageCallsAgent());

// start watching
$telltale->start();

然后您的浏览器将显示如下信息...

Firebug Sample

分析代码片段...

<?php
// ignored
$telltale->start();
// analysed
$telltale->stop();
// ignored

安装

使用 Composer 添加 renanbr/telltale 依赖。

php composer.phar require renanbr/telltale:~1

或更改 composer.json 文件...

{
    "require": {
        "renanbr/telltale": "~1"
    }
}

有关 Composer 文档,请参阅 getcomposer.org

环境要求

鸣谢

这个库受到了 Derick Rethanstracefile analyser scriptZendServer Code Tracing 的启发。