Перенести пользователей в PostgreSQL и добавить пароли

This commit is contained in:
2026-10-06 14:54:34 +03:00
parent 46c00436a0
commit 618d3919d1
17 changed files with 482 additions and 219 deletions
+4
View File
@@ -121,6 +121,9 @@ func run(baseURL string, clients, perClient int) (Report, error) {
return report, nil
}
// clientPassword is shared by the synthetic clients of one run.
const clientPassword = "concurrency-check-password"
func registerClients(api *client, runID string, n int) ([]string, error) {
ids := make([]string, 0, n)
for i := range n {
@@ -128,6 +131,7 @@ func registerClients(api *client, runID string, n int) ([]string, error) {
body := map[string]string{
"username": fmt.Sprintf("load_%s_%d", runID, i),
"display_name": fmt.Sprintf("Load client %d", i),
"password": clientPassword,
}
if err := api.post("/api/v1/users", "", body, &created); err != nil {
return nil, fmt.Errorf("register client %d: %w", i, err)