Skip to content

Commit

Permalink
Stop the stress clients when the stress test is over (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
texuf authored Aug 6, 2024
1 parent c4f0e70 commit 162f0d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/stress/src/mode/chat/root_chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ export async function startStressChat(opts: {

logger.log('done', { summary })

for (let i = 0; i < clients.length; i += 1) {
const client = clients[i]
logger.log(`stopping ${client.logId}`)
await client.stop()
}

return { summary, chatConfig, opts }
}

Expand Down
4 changes: 3 additions & 1 deletion packages/stress/src/utils/stressClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ export class StressClient {
public rpcClient: StreamRpcClient,
public spaceDapp: SpaceDapp,
public streamsClient: StreamsClient,
) {}
) {
logger.log('StressClient', { clientIndex, userId, logId: this.logId })
}

get logId(): string {
return `client${this.clientIndex}:${shortenHexString(this.userId)}`
Expand Down

0 comments on commit 162f0d6

Please sign in to comment.