Files
ulthon_admin/app/admin/scheme/NginxStatUrl.php
augushong 8faa52ce90 feat(nginx-log): 多节点适配(node_id 全链路 + 全局/按节点聚合 + 节点筛选 + v2.4.0 升级脚本)
- 6 张表加 node_id 字段 + position/stat 改复合唯一键(migration)
- 6 个 Scheme 同步 node_id 注解 + 唯一键
- Reader 带 node_id 参数 + 懒加载接管(getLastPosition 回退查 node_id='')
- Aggregator 全局行(node_id='')+ 按节点循环 insertAggregatesForScope
- Stat 所有查询方法加 where node_id 条件
- Dashboard 控制器/视图加节点筛选下拉框 + AJAX 带 node_id
- AccessLog 列表加节点列 + 采集进度卡片显示节点信息
- import 定时任务 run_type 改 all(每节点采集自己的日志)
- v2.4.0 升级脚本追加 ALTER TABLE(幂等 check-then-alter)
- 菜单调整:去掉 Nginx 顶级菜单 + 读取位置管理,改为系统管理下挂两个子菜单
- ulthon-timer 文档补充 run_type=all 多节点部署注意事项
2026-08-08 10:33:20 +08:00

39 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace app\admin\scheme;
use app\common\scheme\BaseScheme;
use app\common\scheme\attribute\Table;
use app\common\scheme\attribute\Field;
use app\common\scheme\attribute\Index;
#[Table(name: 'nginx_stat_url', comment: 'nginx 按 URL 聚合统计')]
#[Index(columns: ['node_id', 'stat_date', 'uri'], name: 'uniq_node_date_uri', type: 'UNIQUE')]
#[Index(columns: ['stat_date'], name: 'idx_stat_date', type: 'NORMAL')]
class NginxStatUrl extends BaseScheme
{
#[Field(type: 'int', length: 11, nullable: false, unsigned: true, autoIncrement: true, primary: true)]
public $id;
#[Field(type: 'varchar', length: 64, nullable: false, default: '', comment: '节点ID区分不同采集节点')]
public $node_id;
#[Field(type: 'int', length: 11, nullable: false, unsigned: true, comment: '统计日期(YYYYMMDD)')]
public $stat_date;
#[Field(type: 'varchar', length: 255, nullable: false, comment: '请求 URI')]
public $uri;
#[Field(type: 'int', length: 11, default: '0', comment: '页面浏览量')]
public $pv;
#[Field(type: 'int', length: 11, default: '0', comment: '独立访客数')]
public $uv;
#[Field(type: 'bigint', default: '0', comment: '总流量(字节)')]
public $total_bytes;
#[Field(type: 'decimal', precision: 10, scale: 3, default: '0.000', comment: '平均请求耗时(秒)')]
public $avg_request_time;
}