2021-01-25 16:40:31 +08:00
|
|
|
package nodes
|
|
|
|
|
|
2021-12-05 18:57:30 +08:00
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeNode/internal/stats"
|
|
|
|
|
)
|
2021-01-25 16:40:31 +08:00
|
|
|
|
|
|
|
|
// 统计
|
|
|
|
|
func (this *HTTPRequest) doStat() {
|
2022-01-01 20:15:39 +08:00
|
|
|
if this.ReqServer == 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)
|
|
|
|
|
stats.SharedHTTPRequestStatManager.AddUserAgent(this.ReqServer.Id, this.requestHeader("User-Agent"))
|
2021-01-25 16:40:31 +08:00
|
|
|
}
|