Skip to content

Commit 922893d

Browse files
committed
add client-provided-name
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
1 parent 0bf99f9 commit 922893d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

perfTest/cmd/commands.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ var (
4747
runDuration int
4848
initialCredits int
4949
isBatchSend bool
50+
clientProvidedName string
5051
)
5152

5253
func init() {
@@ -78,6 +79,7 @@ func setupCli(baseCmd *cobra.Command) {
7879
baseCmd.PersistentFlags().StringVarP(&consumerOffset, "consumer-offset", "", "first", "Staring consuming, ex: first,last,next or random")
7980
baseCmd.PersistentFlags().IntVarP(&initialCredits, "initial-credits", "", 10, "Consumer initial credits")
8081
baseCmd.PersistentFlags().BoolVarP(&isBatchSend, "batch-send", "", false, "Enable batch send")
82+
baseCmd.PersistentFlags().StringVarP(&clientProvidedName, "client-provided-name", "", "", "Client provided name")
8183
baseCmd.AddCommand(versionCmd)
8284
baseCmd.AddCommand(newSilent())
8385
}

perfTest/cmd/silent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,11 @@ func startPublisher(streamName string) error {
271271
if compression == "zstd" {
272272
cp = stream.Compression{}.Zstd()
273273
}
274-
275274
producerOptions.SetSubEntrySize(subEntrySize).SetCompression(cp)
276-
277275
logInfo("Enable SubEntrySize: %d, compression: %s", subEntrySize, cp)
278276
}
279277

278+
producerOptions.SetClientProvidedName(clientProvidedName)
280279
rPublisher, err := ha.NewReliableProducer(simulEnvironment,
281280
streamName,
282281
producerOptions,
@@ -420,6 +419,7 @@ func startConsumer(consumerName string, streamName string) error {
420419
handleMessages,
421420
stream.NewConsumerOptions().
422421
SetConsumerName(consumerName).
422+
SetClientProvidedName(clientProvidedName).
423423
SetOffset(offsetSpec).
424424
SetCRCCheck(crcCheck).
425425
SetInitialCredits(int16(initialCredits)))

0 commit comments

Comments
 (0)