{% extends "base.html" %}
{% block title %}流量异常 - Squid Manager{% endblock %}
{% block content %}
{% if entries_count == 0 %}
🕵️
暂无日志数据
请先到 日志导入 或
路径设置 配置 access.log。
{% else %}
⚙️ 阈值设置 (显示用, 修改后请回到此页面点击刷新)
突增客户端
{{ summary.anomalous_clients | length }}
请求速率突增 > {{ thresholds.spike_warn_ratio }}x
大文件请求
{{ summary.large_requests | length }}
单次响应 > {{ thresholds.large_size_mb }} MB
高频小包客户端
{{ summary.high_freq_small | length }}
响应 < {{ thresholds.small_size_kb }} KB 且请求数 ≥ {{ thresholds.min_small_requests }}
首次出现客户端
{{ summary.new_clients | length }}
本日志切片内首次见到的客户端
🔥 突增客户端
({{ summary.anomalous_clients | length }} 条)
{% if summary.anomalous_clients %}
| 客户端 |
基线请求/分 |
当前请求/分 |
基线总数 |
当前总数 |
倍数 |
严重程度 |
{% for a in summary.anomalous_clients %}
| {{ a.client }} |
{{ '%.2f' % a.baseline_rpm }} |
{{ '%.2f' % a.current_rpm }} |
{{ a.baseline_count }} |
{{ a.current_count }} |
{% if a.ratio == 'inf' or a.ratio == 'Infinity' or (a.ratio is number and a.ratio > 1e15) %}
∞ (基线为 0)
{% else %}
{{ '%.2f' % a.ratio }}x
{% endif %}
|
{{ a.severity }}
|
{% endfor %}
{% else %}
未检测到异常突增客户端。
{% endif %}
💾 异常大文件请求
({{ summary.large_requests | length }} 条)
{% if summary.large_requests %}
| 时间 |
客户端 |
大小 |
方法 |
状态 |
URL |
{% for r in summary.large_requests %}
{{ r.time }} |
{{ r.client }} |
{{ '%.2f' % r.size_mb }} MB
({{ r.size_bytes | thousands }} B)
|
{{ r.method }} |
{{ r.result }} |
{{ r.url }}
{% if r.host %}[{{ r.host }}]{% endif %}
|
{% endfor %}
{% else %}
未检测到 > {{ thresholds.large_size_mb }} MB 的请求。
{% endif %}
📊 高频小包客户端
({{ summary.high_freq_small | length }} 个)
{% if summary.high_freq_small %}
| 客户端 |
请求数 |
总流量 |
平均大小 |
示例主机 |
示例 URL |
{% for c in summary.high_freq_small %}
| {{ c.client }} |
{{ c.request_count | thousands }} |
{{ c.total_bytes | thousands }} B |
{{ '%.0f' % c.avg_size }} B |
{{ c.sample_host or '-' }} |
{{ c.sample_url }}
|
{% endfor %}
{% else %}
未检测到符合条件 (< {{ thresholds.small_size_kb }} KB × ≥ {{ thresholds.min_small_requests }} 次) 的客户端。
{% endif %}
👋 首次出现客户端
({{ summary.new_clients | length }} 个)
{% if summary.new_clients %}
| 客户端 |
首次出现时间 |
本日志段请求数 |
示例 URL |
{% for c in summary.new_clients %}
| {{ c.client }} |
{{ c.first_seen }} |
{{ c.request_count | thousands }} |
{{ c.sample_url }}
|
{% endfor %}
{% else %}
未检测到新出现的客户端。
{% endif %}
{% endif %}
{% endblock %}
{% block scripts %}
{% endblock %}