feat(admin): XHProf 性能日志五张表 Scheme 迁移与模型

This commit is contained in:
augushong
2026-08-14 22:04:52 +08:00
parent da388a8c4f
commit 7e73902325
15 changed files with 478 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace app\admin\model;
use app\common\model\TimeModel;
/**
* @property int $id 主键ID
* @property string $node_id 节点ID区分不同采集节点
* @property string $file_path 日志文件绝对路径
* @property int $inode 文件 inode用于检测日志轮转
* @property int $offset 上次读取到的字节偏移
* @property int $last_read_time 上次读取时间戳
* @property string $last_line_hash 上次最后一行的 md5 哈希(容错校验)
* @property int $parse_fail_count 解析失败累计次数
* @property string $parse_fail_samples 解析失败样本行(最多保留若干条)
* @property int $create_time 创建时间戳
* @property int $update_time 更新时间戳
*/
class XhprofLogPosition extends TimeModel
{
protected $name = "xhprof_log_position";
protected $deleteTime = false;
}

View File

@@ -0,0 +1,26 @@
<?php
namespace app\admin\model;
use app\common\model\TimeModel;
/**
* @property int $id 主键ID
* @property string $node_id 节点ID区分不同采集节点
* @property string $url 请求完整 URL超长截断
* @property string $simple_url 规范化 URL去 query、数字段替换聚合用
* @property string $method HTTP 方法
* @property int $wall_time 总耗时微秒main() 的 wt
* @property int $cpu_time CPU 耗时微秒main() 的 cpu
* @property int $memory_peak 内存峰值字节main() 的 pmu
* @property string $request_time 请求开始时间REQUEST_TIME_FLOAT 浮点秒)
* @property int $create_time 入库时间戳
*/
class XhprofRun extends TimeModel
{
protected $name = "xhprof_run";
protected $deleteTime = false;
}

View File

@@ -0,0 +1,18 @@
<?php
namespace app\admin\model;
use app\common\model\TimeModel;
/**
* @property int $id 主键,值=ul_xhprof_run.id不自增
* @property string $profile_data 原始 profile JSON
*/
class XhprofRunDetail extends TimeModel
{
protected $name = "xhprof_run_detail";
protected $deleteTime = false;
}

View File

@@ -0,0 +1,23 @@
<?php
namespace app\admin\model;
use app\common\model\TimeModel;
/**
* @property int $id 主键ID
* @property int $run_id 采样记录IDul_xhprof_run.id
* @property int $watch_id 监控规则IDul_xhprof_watch.id
* @property int $ct 命中边次数和
* @property int $wt_sum 命中耗时合计(微秒)
* @property int $wt_max 命中单次最大耗时(微秒)
* @property int $create_time 入库时间戳
*/
class XhprofRunWatch extends TimeModel
{
protected $name = "xhprof_run_watch";
protected $deleteTime = false;
}

View File

@@ -0,0 +1,24 @@
<?php
namespace app\admin\model;
use app\common\model\TimeModel;
/**
* @property int $id 主键ID
* @property string $name 规则名称(人读)
* @property string $regex PCRE 正则(对被调用函数名匹配)
* @property string $note 备注
* @property int $threshold_ms 比对阈值毫秒0=不比对
* @property int $status 状态:1=启用,0=禁用
* @property int $create_time 创建时间戳
* @property int $update_time 更新时间戳
*/
class XhprofWatch extends TimeModel
{
protected $name = "xhprof_watch";
protected $deleteTime = false;
}