mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-09-05 07:15:31 +08:00
feat(admin): XHProf 性能日志五张表 Scheme 迁移与模型
This commit is contained in:
27
database/migrations/20260814100004_xhprof_run_watch.php
Normal file
27
database/migrations/20260814100004_xhprof_run_watch.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
|
||||
/**
|
||||
* XHProf 性能日志 - 采样与监控规则命中聚合表
|
||||
*
|
||||
* 导入任务解析 profile 时按启用规则物化(每 run × 每命中规则一条),页面零计算。
|
||||
*/
|
||||
class XhprofRunWatch extends Migrator
|
||||
{
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('xhprof_run_watch', ['id' => false, 'primary_key' => ['id']])
|
||||
->setComment('XHProf 采样与监控规则命中聚合(导入时物化)')
|
||||
->addColumn('id', 'integer', ['limit' => 11, 'null' => false, 'signed' => false, 'identity' => true, 'comment' => '主键ID'])
|
||||
->addColumn('run_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '采样记录ID(ul_xhprof_run.id)', 'signed' => false])
|
||||
->addColumn('watch_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '监控规则ID(ul_xhprof_watch.id)', 'signed' => false])
|
||||
->addColumn('ct', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '命中边次数和'])
|
||||
->addColumn('wt_sum', 'biginteger', ['default' => 0, 'comment' => '命中耗时合计(微秒)'])
|
||||
->addColumn('wt_max', 'biginteger', ['default' => 0, 'comment' => '命中单次最大耗时(微秒)'])
|
||||
->addColumn('create_time', 'integer', ['limit' => 11, 'comment' => '入库时间戳', 'signed' => false])
|
||||
->addIndex(['watch_id', 'create_time'], ['name' => 'idx_watch_time'])
|
||||
->addIndex(['run_id'], ['name' => 'idx_run_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user