feat: complete cmpp platform phases 0-5

This commit is contained in:
hectorzhao
2026-07-01 13:22:04 +08:00
parent 824a8b334f
commit ee926fea04
86 changed files with 10490 additions and 14 deletions
+21
View File
@@ -0,0 +1,21 @@
package main
import (
"log"
"net/http"
"os"
"cmpp-platform/gateway/internal/health"
)
func main() {
addr := os.Getenv("GATEWAY_HEALTH_ADDR")
if addr == "" {
addr = ":8090"
}
log.Printf("cmpp gateway health server listening on %s", addr)
if err := http.ListenAndServe(addr, health.Handler()); err != nil {
log.Fatalf("gateway health server stopped: %v", err)
}
}
+29
View File
@@ -0,0 +1,29 @@
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,
)
}