Skip to content

Commit a355fb1

Browse files
committed
Add load test for bulk messages
1 parent 28e4918 commit a355fb1

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

api/cmd/loadtest/main.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,14 @@ func main() {
2727
func bulkSend() {
2828
var to []string
2929
for i := 0; i < 100; i++ {
30-
to = append(to, os.Getenv("HTTPSMS_TO"))
30+
to = append(to, os.Getenv("HTTPSMS_TO_BULK"))
3131
}
3232

3333
var responsePayload string
3434
err := requests.
35-
URL("/v1/messages/send").
35+
URL("/v1/messages/bulk-send").
3636
Host("api.httpsms.com").
37-
// Host("localhost:8000").
38-
// Scheme("http").
39-
Header("x-api-key", os.Getenv("HTTPSMS_KEY")).
37+
Header("x-api-key", os.Getenv("HTTPSMS_KEY_BULK")).
4038
BodyJSON(&map[string]any{
4139
"content": fmt.Sprintf("Bulk Load Test [%s]", time.Now().Format(time.RFC850)),
4240
"from": os.Getenv("HTTPSMS_FROM_BULK"),
@@ -46,7 +44,8 @@ func bulkSend() {
4644
ToString(&responsePayload).
4745
Fetch(context.Background())
4846
if err != nil {
49-
log.Fatal(stacktrace.Propagate(err, "cannot create json payload"))
47+
log.Println(responsePayload)
48+
log.Fatal(stacktrace.Propagate(err, "cannot create request"))
5049
}
5150
log.Println(responsePayload)
5251
}

0 commit comments

Comments
 (0)