mcp: add a streamable serving benchmark

Add a benchmark using the streamable HTTP handler, and a more realistic input/output signature. Also expose this handler as an example (both a go example and a server in the examples/ directory).
This commit is contained in:
Robert Findley 2025-09-17 17:49:31 -04:00 • committed by GitHub
commit b615fa49b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -287,7 +287,7 @@ func BenchmarkMemoryEventStore(b *testing.B) {
payload := make([]byte, test.datasize)
start := time.Now()
b.ResetTimer()
for i := 0; i < b.N; i++ {
for i := range b.N {
sessionID := sessionIDs[i%len(sessionIDs)]
streamID := streamIDs[i%len(sessionIDs)][i%3]
store.Append(ctx, sessionID, streamID, payload)