[统计]记录流量(以5分钟作为间隔)

This commit is contained in:
GoEdgeLab
2020-12-11 17:27:35 +08:00
parent 6ef59a8e2f
commit e44678b734
7 changed files with 168 additions and 4 deletions

View File

@@ -199,7 +199,14 @@ func (this *HTTPRequest) doBegin() {
// 结束调用
func (this *HTTPRequest) doEnd() {
// 记录日志
this.log()
// 流量统计
// TODO 增加是否开启开关
if this.Server != nil {
SharedTrafficStatManager.Add(this.Server.Id, this.writer.sentBodyBytes)
}
}
// 原始的请求URI