Skip to content

Commit

Permalink
fix(cli):fix the incorrect count
Browse files Browse the repository at this point in the history
  • Loading branch information
ni00 authored and Red-Asuka committed Jun 27, 2023
1 parent e163aa2 commit 4894a40
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/src/lib/conn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const benchConn = async (options: BenchConnectOptions) => {
if (isNewConnArray[i - 1]) {
interactive.success('[%d/%d] - Connected', connectedCount, count)

if (i === count) {
if (connectedCount === count) {
const end = Date.now()
signale.info(`Done, total time: ${(end - start) / 1000}s`)
}
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib/pub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const multiPub = async (commandType: CommandType, options: BenchPublishOptions |
})
}, messageInterval)

if (i === count) {
if (connectedCount === count) {
const connEnd = Date.now()

signale.info(`Created ${count} connections in ${(connEnd - connStart) / 1000}s`)
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib/sub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const benchSub = async (options: BenchSubscribeOptions) => {
}
})

if (i === count && topic[topic.length - 1] === t) {
if (connectedCount === count && topic[topic.length - 1] === t) {
const connEnd = Date.now()

signale.info(`Created ${count} connections in ${(connEnd - connStart) / 1000}s`)
Expand Down

0 comments on commit 4894a40

Please sign in to comment.