当前位置: 首页 > 软件库 > 开发工具 > PHP开发工具 >

xhprof-collector

XHProf 收集器
授权协议 GPL
开发语言 PHP
所属分类 开发工具、 PHP开发工具
软件类型 开源软件
地区 国产
投 递 者 艾奕
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

xhprof-collector

Single XHProf collector use XHProf API.

Notice that this is a collector only, so you have to get a gui to show collected data such as xhgui.

Tested php version

  • 5.6.36

  • 7.0.30

Notice:If you are running php under Kubernetes, you have to use tideways_xhprof extension which only support php >= 7.0 to avoid XHProf crash in hp_execute_internal.

Require

XHProf extension(either)

mongo extension(either)

Symfony Integration Example

Include(either)

  • Composer(recommend)

{
  "require" : {
    "zoa-chou/xhprof-collector": "*",
  }
}
  • Single file

  1. Copy xhprof-collector/src/collector.php to your path

  2. Require collector to your project at first line, such as:

<?php
require_once '/path/to/your/collector.php';
  • Nginx configure

  1. Copy xhprof-collector/src/collector.php to your path

  2. Add fastcgi_param to your nginx config inside server block, such as:

location ~ .*\.php?$ {
    fastcgi_param PHP_VALUE "auto_prepend_file=/path/to/your/collector.php";
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    include fcgi.conf;
}

Notice:Once you visited the host which server configure collector, nginx will always send fastcgi_param to php-fpm even if you visit other not configure server.

  • Append php.ini

  1. Copy xhprof-collector/src/collector.php to your path

  2. Add auto_prepend_file to your php.ini, such as:

auto_prepend_file=/path/to/your/collector.php

Configure environment variables

  • XHGUI_ENABLE_PROB &mdash;&mdash; The probability of start collector while request.Valid value is between 0(off) and 100(all on), default is 0.

  • XHGUI_MONGO_URI &mdash;&mdash; mongodb uri, such as:mongodb://username:password@ip:host,ip2:host2/dbname?connectTimeoutMS=200

  • XHGUI_ENABLE_CLI &mdash;&mdash; Enable collector while php running as cli model.Valid values is 0(off) and 1(on), default is 0.

  • XHGUI_SINGLE_CONTROL &mdash;&mdash; Enable use http header XHGUI-ENABLE-PROB (just like XHGUI_ENABLE_PROB, such as: 'XHGUI-ENABLE-PROB: 100') to control the probability of start collector which will cover XHGUI_ENABLE_PROB. Valid values is 0(off) and 1(on), default is 0.

 相关资料
  • xhprof —— facebook 开发的一个测试php性能的扩展。

  • 我的Ionic 5应用程序中有以下Firestore数据库结构。 书(集合) {bookID}(带有book字段的文档) 赞(子集合) {userID}(文档名称作为带有字段的用户ID) 集合中有文档,每个文档都有一个子集合。Like collection的文档名是喜欢这本书的用户ID。 我正在尝试进行查询以获取最新的,同时尝试从子集合中获取文档以检查我是否喜欢它。 我在这里做的是用每个图书ID调

  • 不保留顺序。我可以使用列表,但我想指出,生成的集合不允许元素重复,这正是接口的用途。

  • 我想获取地图的值,找到min值,并为地图的每个条目构造一个新的CodesWitMinValue实例。我希望使用Java11个流,我可以在多行中使用多个流(一个用于min值,一个用于转换)来实现这一点。是否可以使用java 11流和收集器在单行中实现?谢谢。

  • 问题内容: 是什么决定了垃圾收集器何时真正收集?它是在一定时间之后还是在一定数量的内存用完之后发生的吗?还是还有其他因素? 问题答案: 它在确定是时候运行时运行。在世代垃圾收集器中,一种常见的策略是在第0代内存分配失败时运行收集器。也就是说,每次你分配一小块内存(大块通常直接放置在“旧”代中)时,系统都会检查gen-0堆中是否有足够的可用空间,如果没有,则运行GC释放空间以使分配成功。然后将旧数据

  • 我是使用Java8流API的新手,但我希望使用它来解决以下问题。假设我有一个名为的POJO,它包含、和属性,这些属性可以表示以下内容的每一行记录: 看起来如下: 上述四条记录需要合并为两条按名称分组的记录,其中: 属性求和 属性求和 组合记录包括属性,该属性是和的累加和相乘的结果。 因此,上述结果将是: 一个名为的不同POJO将表示组合记录的每一行记录: 有哪些好的方法/解决方案可以将输入的列表转