code refactor

This commit is contained in:
UlricQin 2021-08-27 18:58:06 +08:00
parent ae0b036ae4
commit d685fa2a30
1 changed files with 5 additions and 5 deletions

View File

@ -55,7 +55,7 @@ func matchMute(metric, ident string, tags map[string]string, classpaths string)
} }
func matchMuteOnce(filter cache.Filter, ident string, tags map[string]string, classpaths string) bool { func matchMuteOnce(filter cache.Filter, ident string, tags map[string]string, classpaths string) bool {
if len(filter.ClasspathPrefix) != 0 && !strings.HasPrefix(classpaths, filter.ClasspathPrefix) && !strings.Contains(classpaths, " "+filter.ClasspathPrefix) { if len(filter.ClasspathPrefix) > 0 && !strings.HasPrefix(classpaths, filter.ClasspathPrefix) && !strings.Contains(classpaths, " "+filter.ClasspathPrefix) {
// 没配置分组屏蔽就不做后续比较 // 没配置分组屏蔽就不做后续比较
// 比如事件的资源calsspath为“n9e.mon n9e.rdb ccp.web”配置屏蔽为n9e.rdb // 比如事件的资源calsspath为“n9e.mon n9e.rdb ccp.web”配置屏蔽为n9e.rdb
// 只要字符串前缀为n9e.rdb或者字符串包含“ n9e.rdb”即可判断所有alsspath中是否有前缀为n9e.rdb的 // 只要字符串前缀为n9e.rdb或者字符串包含“ n9e.rdb”即可判断所有alsspath中是否有前缀为n9e.rdb的