Files
EdgeNode/internal/nodes/http_request_stat.go

17 lines
491 B
Go
Raw Normal View History

2021-01-25 16:40:31 +08:00
package nodes
import (
"github.com/TeaOSLab/EdgeNode/internal/stats"
)
2021-01-25 16:40:31 +08:00
// 统计
func (this *HTTPRequest) doStat() {
if this.ReqServer == nil || this.web == nil || this.web.StatRef == nil {
2021-01-25 16:40:31 +08:00
return
}
2021-06-30 20:01:00 +08:00
// 内置的统计
2022-01-01 20:15:39 +08:00
stats.SharedHTTPRequestStatManager.AddRemoteAddr(this.ReqServer.Id, this.requestRemoteAddr(true), this.writer.SentBodyBytes(), this.isAttack)
2022-12-22 11:38:59 +08:00
stats.SharedHTTPRequestStatManager.AddUserAgent(this.ReqServer.Id, this.requestHeader("User-Agent"), this.remoteAddr)
2021-01-25 16:40:31 +08:00
}