BenchmarkConcurrentHasLinkWithMatching benchmarks concurrent HasLink performance with matching functions. Performance test for concurrent access with temporary role creation.
(b *testing.B)
| 182 | // BenchmarkConcurrentHasLinkWithMatching benchmarks concurrent HasLink performance with matching functions. |
| 183 | // Performance test for concurrent access with temporary role creation. |
| 184 | func BenchmarkConcurrentHasLinkWithMatching(b *testing.B) { |
| 185 | e, _ := NewEnforcer("examples/rbac_with_pattern_model.conf", "examples/rbac_with_pattern_policy.csv") |
| 186 | e.AddNamedMatchingFunc("g2", "keyMatch2", util.KeyMatch2) |
| 187 | rm := e.GetRoleManager() |
| 188 | |
| 189 | b.ResetTimer() |
| 190 | b.RunParallel(func(pb *testing.PB) { |
| 191 | for pb.Next() { |
| 192 | _, _ = rm.HasLink("alice", "/book/123") |
| 193 | } |
| 194 | }) |
| 195 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…