6
kgo.go
6
kgo.go
@@ -267,7 +267,7 @@ func (k *Broker) publish(ctx context.Context, msgs []*broker.Message, opts ...br
|
|||||||
k.connected.Store(1)
|
k.connected.Store(1)
|
||||||
}
|
}
|
||||||
k.Unlock()
|
k.Unlock()
|
||||||
fmt.Printf("EEE\n")
|
|
||||||
options := broker.NewPublishOptions(opts...)
|
options := broker.NewPublishOptions(opts...)
|
||||||
records := make([]*kgo.Record, 0, len(msgs))
|
records := make([]*kgo.Record, 0, len(msgs))
|
||||||
var errs []string
|
var errs []string
|
||||||
@@ -322,9 +322,9 @@ func (k *Broker) publish(ctx context.Context, msgs []*broker.Message, opts ...br
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
ts := time.Now()
|
ts := time.Now()
|
||||||
fmt.Printf("SSSSSSEEE\n")
|
|
||||||
results := k.c.ProduceSync(ctx, records...)
|
results := k.c.ProduceSync(ctx, records...)
|
||||||
fmt.Printf("SSSSSS\n")
|
|
||||||
te := time.Since(ts)
|
te := time.Since(ts)
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
k.opts.Meter.Summary(semconv.PublishMessageLatencyMicroseconds, "endpoint", result.Record.Topic, "topic", result.Record.Topic).Update(te.Seconds())
|
k.opts.Meter.Summary(semconv.PublishMessageLatencyMicroseconds, "endpoint", result.Record.Topic, "topic", result.Record.Topic).Update(te.Seconds())
|
||||||
|
@@ -2,7 +2,6 @@ package kgo_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@@ -214,7 +213,7 @@ func TestPubSub(t *testing.T) {
|
|||||||
if prc := atomic.LoadInt64(&idx); prc == msgcnt {
|
if prc := atomic.LoadInt64(&idx); prc == msgcnt {
|
||||||
close(done)
|
close(done)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("processed %v\n", prc)
|
t.Logf("processed %v\n", prc)
|
||||||
}
|
}
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
close(done)
|
close(done)
|
||||||
|
Reference in New Issue
Block a user