mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-30 12:45:32 +08:00
feat(tools): XHProf 日志导入三层服务与函数监控物化
- XhprofProfileParserService(Base/App):纯数组解析 jsonl 行, meta 字段以真实 fixture 为准;simple_url 缺失兜底与采集端回调同算法; watch 正则按 callee 物化(ct/wt_sum/wt_max),非法正则编译计 fail 跳过 - XhprofLogReaderService(Base/App):增量读取,半行缓冲超限整行丢弃 (不照抄 nginx 8MB 强制切行);EOF 无换行半行不 yield 不推进 offset; 进度不自动落盘,由导入侧在同一事务内显式 savePosition - XhprofLogImport 定时任务(Base/App):不受 XHPROF_ENABLE 门控, runs-*.jsonl 按文件名序增量导入;run 逐条 insert + detail chunk 20 insertAll + run_watch insertAll 与 position 同事务落盘;导至 EOF 后 只删已导完文件 - 修复 T1 缺陷:request_time decimal(12,3) 装不下 10 位时间戳, Scheme 与 migration 同步改 decimal(13,3) - 新增 parser 单元测试(真实 fixture 断言,9 用例 42 断言) 与 jsonl fixture;phpunit 注册 unit 测试套件
This commit is contained in:
20
app/common/service/XhprofLogReaderService.php
Normal file
20
app/common/service/XhprofLogReaderService.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\common\service;
|
||||
|
||||
use base\common\service\XhprofLogReaderServiceBase;
|
||||
|
||||
/**
|
||||
* XHProf jsonl 增量读取 service(App 入口类).
|
||||
*
|
||||
* 框架内部所有调用走本类(依赖倒置):
|
||||
* `new \app\common\service\XhprofLogReaderService()`,
|
||||
* 业务侧如需定制读取逻辑,重写本类对应方法即可拦截。
|
||||
*
|
||||
* 全部逻辑由 XhprofLogReaderServiceBase 提供,本类默认仅继承不修改。
|
||||
*/
|
||||
class XhprofLogReaderService extends XhprofLogReaderServiceBase
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user