Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ export async function displaySvgDecoration(
discarded: false,
},
},
totalSessionDisplayTime: Date.now() - session.requestStartTime,
firstCompletionDisplayLatency: session.firstCompletionDisplayLatency,
isInlineEdit: true,
}
languageClient.sendNotification('aws/logInlineCompletionSessionResults', params)
Expand Down
11 changes: 7 additions & 4 deletions packages/amazonq/src/app/inline/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ export class InlineCompletionManager implements Disposable {
const onInlineRejection = async () => {
try {
vsCodeState.isCodeWhispererEditing = true
if (this.sessionManager.getActiveSession() === undefined) {
const session = this.sessionManager.getActiveSession()
if (session === undefined) {
return
}
const requestStartTime = this.sessionManager.getActiveSession()!.requestStartTime
const requestStartTime = session.requestStartTime
const totalSessionDisplayTime = performance.now() - requestStartTime
await commands.executeCommand('editor.action.inlineSuggest.hide')
// TODO: also log the seen state for other suggestions in session
Expand All @@ -182,9 +183,9 @@ export class InlineCompletionManager implements Disposable {
CodeWhispererConstants.platformLanguageIds,
this.inlineCompletionProvider
)
const sessionId = this.sessionManager.getActiveSession()?.sessionId
const sessionId = session.sessionId
const itemId = this.sessionManager.getActiveRecommendation()[0]?.itemId
if (!sessionId || !itemId) {
if (!itemId) {
return
}
const params: LogInlineCompletionSessionResultsParams = {
Expand All @@ -196,6 +197,7 @@ export class InlineCompletionManager implements Disposable {
discarded: false,
},
},
firstCompletionDisplayLatency: session.firstCompletionDisplayLatency,
totalSessionDisplayTime: totalSessionDisplayTime,
}
this.languageClient.sendNotification(this.logSessionResultMessageName, params)
Expand Down Expand Up @@ -343,6 +345,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
discarded: !prevSession.displayed,
},
},
firstCompletionDisplayLatency: prevSession.firstCompletionDisplayLatency,
totalSessionDisplayTime: performance.now() - prevSession.requestStartTime,
}
this.languageClient.sendNotification(this.logSessionResultMessageName, params)
Expand Down
Loading