Skip to content

Commit a9a027c

Browse files
Fixed sharded pubsub subscriber check (#24)
* Added the option to measure rtt * fixed ssubscriber check --------- Co-authored-by: fcostaoliveira <filipe@redis.com>
1 parent 03bb47b commit a9a027c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

subscriber.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -615,15 +615,16 @@ func updateCLI(
615615
// Header
616616
if measureRTT {
617617
fmt.Fprint(w, "Test Time\tTotal Messages\t Message Rate \tConnect Rate \t")
618-
if strings.HasPrefix(mode, "subscribe") {
618+
619+
if strings.Contains(mode, "subscribe") {
619620
fmt.Fprint(w, "Active subscriptions\t")
620621
} else {
621622
fmt.Fprint(w, "Active publishers\t")
622623
}
623624
fmt.Fprint(w, "Avg RTT (ms)\t\n")
624625
} else {
625626
fmt.Fprint(w, "Test Time\tTotal Messages\t Message Rate \tConnect Rate \t")
626-
if strings.HasPrefix(mode, "subscribe") {
627+
if strings.Contains(mode, "subscribe") {
627628
fmt.Fprint(w, "Active subscriptions\t\n")
628629
} else {
629630
fmt.Fprint(w, "Active publishers\t\n")
@@ -657,7 +658,7 @@ func updateCLI(
657658
// Metrics line
658659
fmt.Fprintf(w, "%.0f\t%d\t%.2f\t%.2f\t", time.Since(start).Seconds(), totalMessages, messageRate, connectRate)
659660

660-
if strings.HasPrefix(mode, "subscribe") {
661+
if strings.Contains(mode, "subscribe") {
661662
fmt.Fprintf(w, "%d\t", totalSubscribedChannels)
662663
} else {
663664
fmt.Fprintf(w, "%d\t", atomic.LoadInt64(&totalPublishers))

0 commit comments

Comments
 (0)