30 lines
550 B
Go
30 lines
550 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"log"
|
|
"time"
|
|
|
|
"cmpp-platform/gateway/internal/spike"
|
|
)
|
|
|
|
func main() {
|
|
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
|
defer cancel()
|
|
|
|
sim := spike.NewSimulator()
|
|
result, err := sim.RunLoad(ctx, 15000)
|
|
if err != nil {
|
|
log.Fatalf("run spike load: %v", err)
|
|
}
|
|
|
|
fmt.Printf("submitted=%d submitResults=%d receiptEvents=%d duration=%s throughput=%.2f msg/s\n",
|
|
result.Submitted,
|
|
result.SubmitResults,
|
|
result.ReceiptEvents,
|
|
result.Duration,
|
|
result.MessagesPerSec,
|
|
)
|
|
}
|