合并多个计数器,便于统一的内存控制

This commit is contained in:
GoEdgeLab
2023-10-05 09:45:46 +08:00
parent 4cebb4d876
commit b6c19168fd
7 changed files with 18 additions and 28 deletions

View File

@@ -8,7 +8,6 @@ import (
"regexp"
)
var ccCounter = counters.NewCounter().WithGC()
// CCCheckpoint ${cc.arg}
// TODO implement more traffic rules
@@ -98,7 +97,7 @@ func (this *CCCheckpoint) RequestValue(req requests.Request, param string, optio
if len(key) == 0 {
key = req.WAFRemoteIP()
}
value = ccCounter.IncreaseKey(types.String(ruleId)+"@"+key, types.Int(period))
value = counters.SharedCounter.IncreaseKey(types.String(ruleId)+"@WAF_CC@"+key, types.Int(period))
}
return