@@ -115,7 +115,7 @@ export class InlineCompletionManager implements Disposable {
115
115
const startLine = position . line
116
116
// TODO: also log the seen state for other suggestions in session
117
117
// Calculate timing metrics before diagnostic delay
118
- const totalSessionDisplayTime = performance . now ( ) - requestStartTime
118
+ const totalSessionDisplayTime = Date . now ( ) - requestStartTime
119
119
await sleep ( 500 )
120
120
const diagnosticDiff = getDiagnosticsDifferences (
121
121
this . sessionManager . getActiveSession ( ) ?. diagnosticsBeforeAccept ,
@@ -175,7 +175,7 @@ export class InlineCompletionManager implements Disposable {
175
175
return
176
176
}
177
177
const requestStartTime = session . requestStartTime
178
- const totalSessionDisplayTime = performance . now ( ) - requestStartTime
178
+ const totalSessionDisplayTime = Date . now ( ) - requestStartTime
179
179
await commands . executeCommand ( 'editor.action.inlineSuggest.hide' )
180
180
// TODO: also log the seen state for other suggestions in session
181
181
this . disposable . dispose ( )
@@ -249,7 +249,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
249
249
// Use VS Code command to check if inline suggestion is actually visible on screen
250
250
// This command only executes when inlineSuggestionVisible context is true
251
251
await vscode . commands . executeCommand ( 'aws.amazonq.checkInlineSuggestionVisibility' )
252
- const isInlineSuggestionVisible = performance . now ( ) - session . lastVisibleTime < 50
252
+ const isInlineSuggestionVisible = Date . now ( ) - session . lastVisibleTime < 50
253
253
return isInlineSuggestionVisible
254
254
}
255
255
@@ -278,7 +278,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
278
278
sessionId : session . sessionId ,
279
279
completionSessionResult,
280
280
firstCompletionDisplayLatency : session . firstCompletionDisplayLatency ,
281
- totalSessionDisplayTime : performance . now ( ) - session . requestStartTime ,
281
+ totalSessionDisplayTime : Date . now ( ) - session . requestStartTime ,
282
282
}
283
283
this . languageClient . sendNotification ( this . logSessionResultMessageName , params )
284
284
}
@@ -309,7 +309,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
309
309
// when hitting other keystrokes, the context.triggerKind is Automatic (1)
310
310
// we only mark option + C as manual trigger
311
311
// this is a workaround since the inlineSuggest.trigger command take no params
312
- const isAutoTrigger = performance . now ( ) - vsCodeState . lastManualTriggerTime > 50
312
+ const isAutoTrigger = Date . now ( ) - vsCodeState . lastManualTriggerTime > 50
313
313
if ( isAutoTrigger && ! CodeSuggestionsState . instance . isSuggestionsEnabled ( ) ) {
314
314
// return early when suggestions are disabled with auto trigger
315
315
return [ ]
@@ -318,9 +318,9 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
318
318
// yield event loop to let the document listen catch updates
319
319
await sleep ( 1 )
320
320
321
- let logstr = `GenerateCompletion metadata :\\n`
321
+ let logstr = `GenerateCompletion activity :\\n`
322
322
try {
323
- const t0 = performance . now ( )
323
+ const t0 = Date . now ( )
324
324
vsCodeState . isRecommendationsActive = true
325
325
// handling previous session
326
326
const prevSession = this . sessionManager . getActiveSession ( )
@@ -365,7 +365,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
365
365
// re-use previous suggestions as long as new typed prefix matches
366
366
if ( prevItemMatchingPrefix . length > 0 ) {
367
367
logstr += `- not call LSP and reuse previous suggestions that match user typed characters
368
- - duration between trigger to completion suggestion is displayed ${ performance . now ( ) - t0 } `
368
+ - duration between trigger to completion suggestion is displayed ${ Date . now ( ) - t0 } `
369
369
void this . checkWhetherInlineCompletionWasShown ( )
370
370
return prevItemMatchingPrefix
371
371
}
@@ -381,7 +381,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
381
381
} ,
382
382
} ,
383
383
firstCompletionDisplayLatency : prevSession . firstCompletionDisplayLatency ,
384
- totalSessionDisplayTime : performance . now ( ) - prevSession . requestStartTime ,
384
+ totalSessionDisplayTime : Date . now ( ) - prevSession . requestStartTime ,
385
385
}
386
386
this . languageClient . sendNotification ( this . logSessionResultMessageName , params )
387
387
this . sessionManager . clear ( )
@@ -396,7 +396,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
396
396
TelemetryHelper . instance . setInvokeSuggestionStartTime ( )
397
397
TelemetryHelper . instance . setTriggerType ( context . triggerKind )
398
398
399
- const t1 = performance . now ( )
399
+ const t1 = Date . now ( )
400
400
401
401
await this . recommendationService . getAllRecommendations (
402
402
this . languageClient ,
@@ -418,7 +418,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
418
418
// eslint-disable-next-line @typescript-eslint/no-base-to-string
419
419
const itemLog = items [ 0 ] ? `${ items [ 0 ] . insertText . toString ( ) } ` : `no suggestion`
420
420
421
- const t2 = performance . now ( )
421
+ const t2 = Date . now ( )
422
422
423
423
logstr += `- number of suggestions: ${ items . length }
424
424
- sessionId: ${ this . sessionManager . getActiveSession ( ) ?. sessionId }
@@ -468,7 +468,7 @@ ${itemLog}
468
468
const lastDocumentChange = this . documentEventListener . getLastDocumentChangeEvent ( document . uri . fsPath )
469
469
if (
470
470
lastDocumentChange &&
471
- performance . now ( ) - lastDocumentChange . timestamp < CodeWhispererConstants . inlineSuggestionShowDelay
471
+ Date . now ( ) - lastDocumentChange . timestamp < CodeWhispererConstants . inlineSuggestionShowDelay
472
472
) {
473
473
await sleep ( CodeWhispererConstants . showRecommendationTimerPollPeriod )
474
474
} else {
@@ -486,7 +486,7 @@ ${itemLog}
486
486
// Check if Next Edit Prediction feature flag is enabled
487
487
if ( Experiments . instance . get ( 'amazonqLSPNEP' , true ) ) {
488
488
await showEdits ( item , editor , session , this . languageClient , this )
489
- logstr += `- duration between trigger to edits suggestion is displayed: ${ performance . now ( ) - t0 } ms`
489
+ logstr += `- duration between trigger to edits suggestion is displayed: ${ Date . now ( ) - t0 } ms`
490
490
}
491
491
return [ ]
492
492
}
@@ -530,7 +530,7 @@ ${itemLog}
530
530
531
531
this . sessionManager . updateCodeReferenceAndImports ( )
532
532
// suggestions returned here will be displayed on screen
533
- logstr += `- duration between trigger to completion suggestion is displayed: ${ performance . now ( ) - t0 } ms`
533
+ logstr += `- duration between trigger to completion suggestion is displayed: ${ Date . now ( ) - t0 } ms`
534
534
void this . checkWhetherInlineCompletionWasShown ( )
535
535
return itemsMatchingTypeahead as InlineCompletionItem [ ]
536
536
} catch ( e ) {
0 commit comments