mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-31 05:05:33 +08:00
- extend/base/admin/controller/system/NginxLogStatBase.php:完整逻辑
- @ControllerAnnotation(title=Nginx访问统计) + @NodeAnotation(title=访问统计)
- index() 页面/接口同体:isAjax() 返回 JSON,否则 fetch()
- period 解析:day(24h)/week(7d)/month(30d)/year(12m)/custom,invalid 自动 fallback day
- custom start>end 自动 swap
- 整体指标:SUM stat_hour,avg_request_time 按 PV 加权平均
- 趋势:day 按 stat_hour 聚合补 0-23;week/month/custom 按 stat_date 补日期序列;year 按 (stat_date DIV 100) 聚合补 1-12 月
- Top N:sysconfig('nginx_log','topn_default',10),topN=0 不截断
- 跨周期 UV 标注:uv_is_estimate = period !== 'day'
- 空表/空范围不崩(返回 0/[])
- app/admin/controller/system/NginxLogStat.php:App 入口,仅 extends Base
性能:stat_hour 10 万行 + period=year 服务端 < 700ms(< 2s 要求)
依赖:T1 stat 模型、T9 Aggregate;blocks:T13 视图
15 lines
286 B
PHP
15 lines
286 B
PHP
<?php
|
||
|
||
namespace app\admin\controller\system;
|
||
|
||
use base\admin\controller\system\NginxLogStatBase;
|
||
|
||
/**
|
||
* Nginx 访问统计仪表盘(App 入口层)
|
||
*
|
||
* 仅继承 Base,业务方需要覆盖逻辑时在此重写对应方法。
|
||
*/
|
||
class NginxLogStat extends NginxLogStatBase
|
||
{
|
||
}
|