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 @@ -124,6 +124,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
)

val job = startTestGenerationResponse.testGenerationJob()
session.startTestGenerationRequestId = startTestGenerationResponse.responseMetadata().requestId()
session.testGenerationJobGroupName = job.testGenerationJobGroupName()
session.testGenerationJob = job.testGenerationJobId()
throwIfCancelled(session)
Expand Down Expand Up @@ -522,7 +523,8 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
isCodeBlockSelected = session.isCodeBlockSelected,
artifactsUploadDuration = session.artifactUploadDuration,
buildPayloadBytes = session.srcPayloadSize,
buildZipFileBytes = session.srcZipFileSize
buildZipFileBytes = session.srcZipFileSize,
requestId = session.startTestGenerationRequestId
)
session.isGeneratingTests = false
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,18 @@ class CodeTestChatController(
val request = requestData.toChatRequest()
client.generateAssistantResponse(request, responseHandler).await()
// TODO: Need to send isCodeBlockSelected field
AmazonqTelemetry.utgGenerateTests(
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
hasUserPromptSupplied = session.hasUserPromptSupplied,
isSupportedLanguage = false,
credentialStartUrl = getStartUrl(project),
result = MetricResult.Succeeded,
perfClientLatency = (Instant.now().toEpochMilli() - session.startTimeOfTestGeneration)
)
requestId.let { id ->
LOG.debug { "$FEATURE_NAME: Unit test generation requestId: $id" }
AmazonqTelemetry.utgGenerateTests(
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
hasUserPromptSupplied = session.hasUserPromptSupplied,
isSupportedLanguage = false,
credentialStartUrl = getStartUrl(project),
result = MetricResult.Succeeded,
perfClientLatency = (Instant.now().toEpochMilli() - session.startTimeOfTestGeneration),
requestId = id
)
}
session.isGeneratingTests = false
codeTestChatHelper.updateUI(
loadingChat = false,
Expand Down Expand Up @@ -599,7 +603,8 @@ class CodeTestChatController(
isCodeBlockSelected = session.isCodeBlockSelected,
artifactsUploadDuration = session.artifactUploadDuration,
buildPayloadBytes = session.srcPayloadSize,
buildZipFileBytes = session.srcZipFileSize
buildZipFileBytes = session.srcZipFileSize,
requestId = session.startTestGenerationRequestId
)
codeTestChatHelper.addAnswer(
CodeTestChatMessageContent(
Expand Down Expand Up @@ -792,7 +797,8 @@ class CodeTestChatController(
isCodeBlockSelected = session.isCodeBlockSelected,
artifactsUploadDuration = session.artifactUploadDuration,
buildPayloadBytes = session.srcPayloadSize,
buildZipFileBytes = session.srcZipFileSize
buildZipFileBytes = session.srcZipFileSize,
requestId = session.startTestGenerationRequestId
)
sessionCleanUp(message.tabId)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ data class Session(val tabId: String) {
var programmingLanguage: CodeWhispererProgrammingLanguage = CodeWhispererUnknownLanguage.INSTANCE
var testGenerationJob: String = ""
var testGenerationJobGroupName: String = ""
var startTestGenerationRequestId: String = ""

// Telemetry
var hasUserPromptSupplied: Boolean = false
Expand Down
Loading