Skip to content

Commit fb2b6c9

Browse files
committed
fixup
1 parent 10e3ec8 commit fb2b6c9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/core/src/amazonq/messages/chatMessageDuration.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ export class AmazonQChatMessageDuration {
4343
/**
4444
* Stop listening to all incoming events and emit what we've found
4545
*/
46-
static stopChatMessageTelemetry(msg: { tabID: string; time: number }) {
47-
const { tabID, time } = msg
46+
static stopChatMessageTelemetry(msg: { tabID: string; time: number; tabType: TabType }) {
47+
const { tabID, time, tabType } = msg
48+
4849
// We can't figure out what trace this event was associated with
49-
if (!tabID) {
50+
if (!tabID || tabType !== 'cwc') {
5051
return
5152
}
5253

packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ export class CWCTelemetryHelper {
491491
}
492492

493493
public setResponseStreamStartTime(tabID: string) {
494-
this.responseStreamStartTime.set(tabID, globals.clock.Date.now())
494+
this.responseStreamStartTime.set(tabID, performance.now())
495495
this.responseStreamTimeForChunks.set(tabID, [performance.now()])
496496
this.displayTimeForChunks.set(tabID, [])
497497
}
@@ -545,7 +545,7 @@ export class CWCTelemetryHelper {
545545
}
546546

547547
public setResponseStreamTotalTime(tabID: string) {
548-
const totalTime = globals.clock.Date.now() - (this.responseStreamStartTime.get(tabID) ?? 0)
548+
const totalTime = performance.now() - (this.responseStreamStartTime.get(tabID) ?? 0)
549549
this.responseStreamTotalTime.set(tabID, Math.round(totalTime))
550550
}
551551

0 commit comments

Comments
 (0)