File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
codewhispererChat/controllers/chat Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments