mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-02 14:00:25 +08:00
在请求上下文中停用统计的时候也停用对应的指标统计
This commit is contained in:
@@ -103,6 +103,8 @@ type HTTPRequest struct {
|
||||
disableLog bool // 是否在当前请求中关闭Log
|
||||
forceLog bool // 是否强制记录日志
|
||||
|
||||
disableMetrics bool // 不记录统计指标
|
||||
|
||||
isHijacked bool
|
||||
|
||||
// script相关操作
|
||||
@@ -458,7 +460,7 @@ func (this *HTTPRequest) doEnd() {
|
||||
stats.SharedDAUManager.AddIP(this.ReqServer.Id, this.requestRemoteAddr(true))
|
||||
|
||||
// 指标
|
||||
if metrics.SharedManager.HasHTTPMetrics() {
|
||||
if !this.disableMetrics && metrics.SharedManager.HasHTTPMetrics() {
|
||||
this.doMetricsResponse()
|
||||
}
|
||||
|
||||
|
||||
@@ -546,4 +546,6 @@ func (this *HTTPRequest) DisableStat() {
|
||||
if this.web != nil {
|
||||
this.web.StatRef = nil
|
||||
}
|
||||
|
||||
this.disableMetrics = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user