国家/地区统计时上传流量、攻击量等信息

This commit is contained in:
GoEdgeLab
2021-12-05 18:57:30 +08:00
parent 362de3325e
commit 09b6a763e7
3 changed files with 58 additions and 26 deletions

View File

@@ -1,6 +1,8 @@
package nodes
import "github.com/TeaOSLab/EdgeNode/internal/stats"
import (
"github.com/TeaOSLab/EdgeNode/internal/stats"
)
// 统计
func (this *HTTPRequest) doStat() {
@@ -9,6 +11,6 @@ func (this *HTTPRequest) doStat() {
}
// 内置的统计
stats.SharedHTTPRequestStatManager.AddRemoteAddr(this.Server.Id, this.requestRemoteAddr(true))
stats.SharedHTTPRequestStatManager.AddRemoteAddr(this.Server.Id, this.requestRemoteAddr(true), this.writer.SentBodyBytes(), this.isAttack)
stats.SharedHTTPRequestStatManager.AddUserAgent(this.Server.Id, this.requestHeader("User-Agent"))
}