(b *testing.B)
| 110 | } |
| 111 | |
| 112 | func BenchmarkIPList_Add(b *testing.B) { |
| 113 | runtime.GOMAXPROCS(1) |
| 114 | |
| 115 | var list = waf.NewIPList(waf.IPListTypeDeny) |
| 116 | for i := 0; i < b.N; i++ { |
| 117 | list.Add(waf.IPTypeAll, firewallconfigs.FirewallScopeGlobal, 1, "192.168.1."+strconv.Itoa(i), time.Now().Unix()+3600) |
| 118 | } |
| 119 | b.Log(len(list.IPMap())) |
| 120 | } |
| 121 | |
| 122 | func BenchmarkIPList_Has(b *testing.B) { |
| 123 | runtime.GOMAXPROCS(1) |