mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
chore: add global caching to rbac (#7439)
Co-authored-by: Steven Masley <stevenmasley@coder.com>
This commit is contained in:
@ -1671,3 +1671,18 @@ func sortUsers(users []codersdk.User) {
|
||||
return users[i].CreatedAt.Before(users[j].CreatedAt)
|
||||
})
|
||||
}
|
||||
|
||||
func BenchmarkUsersMe(b *testing.B) {
|
||||
client := coderdtest.New(b, nil)
|
||||
_ = coderdtest.CreateFirstUser(b, client)
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := client.User(ctx, codersdk.Me)
|
||||
require.NoError(b, err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user