(b *testing.B)
| 1018 | } |
| 1019 | |
| 1020 | func BenchmarkFilterMatch(b *testing.B) { |
| 1021 | b.Run("not-local-v4", func(b *testing.B) { |
| 1022 | benchmarkFile(b, "testdata/matches-1.json", benchOpt{v4: true, validLocalDst: false}) |
| 1023 | }) |
| 1024 | b.Run("not-local-v6", func(b *testing.B) { |
| 1025 | benchmarkFile(b, "testdata/matches-1.json", benchOpt{v4: false, validLocalDst: false}) |
| 1026 | }) |
| 1027 | b.Run("no-match-v4", func(b *testing.B) { |
| 1028 | benchmarkFile(b, "testdata/matches-1.json", benchOpt{v4: true, validLocalDst: true}) |
| 1029 | }) |
| 1030 | b.Run("no-match-v6", func(b *testing.B) { |
| 1031 | benchmarkFile(b, "testdata/matches-1.json", benchOpt{v4: false, validLocalDst: true}) |
| 1032 | }) |
| 1033 | b.Run("tcp-not-syn-v4", func(b *testing.B) { |
| 1034 | benchmarkFile(b, "testdata/matches-1.json", benchOpt{ |
| 1035 | v4: true, |
| 1036 | validLocalDst: true, |
| 1037 | tcpNotSYN: true, |
| 1038 | wantAccept: true, |
| 1039 | }) |
| 1040 | }) |
| 1041 | b.Run("udp-existing-flow-v4", func(b *testing.B) { |
| 1042 | benchmarkFile(b, "testdata/matches-1.json", benchOpt{ |
| 1043 | v4: true, |
| 1044 | validLocalDst: true, |
| 1045 | udp: true, |
| 1046 | udpOpen: true, |
| 1047 | wantAccept: true, |
| 1048 | }) |
| 1049 | }) |
| 1050 | b.Run("tcp-not-syn-v4-no-logs", func(b *testing.B) { |
| 1051 | benchmarkFile(b, "testdata/matches-1.json", benchOpt{ |
| 1052 | v4: true, |
| 1053 | validLocalDst: true, |
| 1054 | tcpNotSYN: true, |
| 1055 | wantAccept: true, |
| 1056 | noLogs: true, |
| 1057 | }) |
| 1058 | }) |
| 1059 | } |
| 1060 | |
| 1061 | type benchOpt struct { |
| 1062 | v4 bool |
nothing calls this directly
no test coverage detected
searching dependent graphs…