@@ -102,18 +102,18 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
102102 cwsprChatUserIntent = data.userIntent?.let { getTelemetryUserIntent(it) },
103103 cwsprChatHasCodeSnippet = data.activeFileContext.focusAreaContext?.codeSelection?.isNotEmpty() ? : false ,
104104 cwsprChatProgrammingLanguage = data.activeFileContext.fileContext?.fileLanguage,
105- cwsprChatActiveEditorTotalCharacters = data.activeFileContext.focusAreaContext?.codeSelection?.length,
106- cwsprChatActiveEditorImportCount = data.activeFileContext.focusAreaContext?.codeNames?.fullyQualifiedNames?.used?.size,
107- cwsprChatResponseCodeSnippetCount = numberOfCodeBlocks,
108- cwsprChatResponseCode = statusCode,
109- cwsprChatSourceLinkCount = response.relatedSuggestions?.size,
105+ cwsprChatActiveEditorTotalCharacters = data.activeFileContext.focusAreaContext?.codeSelection?.length?.toLong() ,
106+ cwsprChatActiveEditorImportCount = data.activeFileContext.focusAreaContext?.codeNames?.fullyQualifiedNames?.used?.size?.toLong() ,
107+ cwsprChatResponseCodeSnippetCount = numberOfCodeBlocks.toLong() ,
108+ cwsprChatResponseCode = statusCode.toLong() ,
109+ cwsprChatSourceLinkCount = response.relatedSuggestions?.size?.toLong() ,
110110 cwsprChatReferencesCount = 0 , // TODO
111- cwsprChatFollowUpCount = response.followUps?.size,
112- cwsprChatTimeToFirstChunk = getResponseStreamTimeToFirstChunk(response.tabId).toInt (),
111+ cwsprChatFollowUpCount = response.followUps?.size?.toLong() ,
112+ cwsprChatTimeToFirstChunk = getResponseStreamTimeToFirstChunk(response.tabId).toLong (),
113113 cwsprChatTimeBetweenChunks = " [${getResponseStreamTimeBetweenChunks(response.tabId).joinToString(" ," )} ]" ,
114- cwsprChatFullResponseLatency = responseStreamTotalTime[response.tabId] ? : 0 ,
115- cwsprChatRequestLength = data.message.length,
116- cwsprChatResponseLength = responseLength,
114+ cwsprChatFullResponseLatency = responseStreamTotalTime[response.tabId]?.toLong() ? : 0 ,
115+ cwsprChatRequestLength = data.message.length.toLong() ,
116+ cwsprChatResponseLength = responseLength.toLong() ,
117117 cwsprChatConversationType = CwsprChatConversationType .Chat ,
118118 credentialStartUrl = getStartUrl(context.project),
119119 codewhispererCustomizationArn = data.customization?.arn,
@@ -152,10 +152,10 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
152152 cwsprChatUserIntent = data.userIntent?.let { getTelemetryUserIntent(it) },
153153 cwsprChatHasCodeSnippet = data.activeFileContext.focusAreaContext?.codeSelection?.isNotEmpty() ? : false ,
154154 cwsprChatProgrammingLanguage = data.activeFileContext.fileContext?.fileLanguage,
155- cwsprChatActiveEditorTotalCharacters = data.activeFileContext.focusAreaContext?.codeSelection?.length,
156- cwsprChatActiveEditorImportCount = data.activeFileContext.focusAreaContext?.codeNames?.fullyQualifiedNames?.used?.size,
157- cwsprChatResponseCode = responseCode,
158- cwsprChatRequestLength = data.message.length,
155+ cwsprChatActiveEditorTotalCharacters = data.activeFileContext.focusAreaContext?.codeSelection?.length?.toLong() ,
156+ cwsprChatActiveEditorImportCount = data.activeFileContext.focusAreaContext?.codeNames?.fullyQualifiedNames?.used?.size?.toLong() ,
157+ cwsprChatResponseCode = responseCode.toLong() ,
158+ cwsprChatRequestLength = data.message.length.toLong() ,
159159 cwsprChatConversationType = CwsprChatConversationType .Chat ,
160160 credentialStartUrl = getStartUrl(context.project)
161161 )
@@ -210,13 +210,14 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
210210 AmazonqTelemetry .interactWithMessage(
211211 cwsprChatConversationId = getConversationId(message.tabId).orEmpty(),
212212 cwsprChatMessageId = message.messageId,
213+ cwsprChatUserIntent = message.userIntent?.let { getTelemetryUserIntent(it) },
213214 cwsprChatInteractionType = CwsprChatInteractionType .CopySnippet ,
214- cwsprChatAcceptedCharactersLength = message.code.length,
215+ cwsprChatAcceptedCharactersLength = message.code.length.toLong() ,
215216 cwsprChatInteractionTarget = message.insertionTargetType,
216217 cwsprChatHasReference = null ,
217218 credentialStartUrl = getStartUrl(context.project),
218- cwsprChatCodeBlockIndex = message.codeBlockIndex,
219- cwsprChatTotalCodeBlocks = message.totalCodeBlocks,
219+ cwsprChatCodeBlockIndex = message.codeBlockIndex?.toLong() ,
220+ cwsprChatTotalCodeBlocks = message.totalCodeBlocks?.toLong() ,
220221 cwsprChatHasProjectContext = getMessageHasProjectContext(message.messageId)
221222 )
222223 ChatInteractWithMessageEvent .builder().apply {
@@ -233,14 +234,15 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
233234 AmazonqTelemetry .interactWithMessage(
234235 cwsprChatConversationId = getConversationId(message.tabId).orEmpty(),
235236 cwsprChatMessageId = message.messageId,
237+ cwsprChatUserIntent = message.userIntent?.let { getTelemetryUserIntent(it) },
236238 cwsprChatInteractionType = CwsprChatInteractionType .InsertAtCursor ,
237- cwsprChatAcceptedCharactersLength = message.code.length,
238- cwsprChatAcceptedNumberOfLines = message.code.lines().size,
239+ cwsprChatAcceptedCharactersLength = message.code.length.toLong() ,
240+ cwsprChatAcceptedNumberOfLines = message.code.lines().size.toLong() ,
239241 cwsprChatInteractionTarget = message.insertionTargetType,
240242 cwsprChatHasReference = null ,
241243 credentialStartUrl = getStartUrl(context.project),
242- cwsprChatCodeBlockIndex = message.codeBlockIndex,
243- cwsprChatTotalCodeBlocks = message.totalCodeBlocks,
244+ cwsprChatCodeBlockIndex = message.codeBlockIndex?.toLong() ,
245+ cwsprChatTotalCodeBlocks = message.totalCodeBlocks?.toLong() ,
244246 cwsprChatHasProjectContext = getMessageHasProjectContext(message.messageId)
245247 )
246248 ChatInteractWithMessageEvent .builder().apply {
@@ -422,11 +424,11 @@ class TelemetryHelper(private val context: AmazonQAppInitContext, private val se
422424 AmazonqTelemetry .indexWorkspace(
423425 project = null ,
424426 duration = duration,
425- amazonqIndexFileCount = fileCount,
426- amazonqIndexFileSizeInMB = fileSize,
427+ amazonqIndexFileCount = fileCount.toLong() ,
428+ amazonqIndexFileSizeInMB = fileSize.toLong() ,
427429 success = isSuccess,
428- amazonqIndexMemoryUsageInMB = memoryUsage,
429- amazonqIndexCpuUsagePercentage = cpuUsage,
430+ amazonqIndexMemoryUsageInMB = memoryUsage?.toLong() ,
431+ amazonqIndexCpuUsagePercentage = cpuUsage?.toLong() ,
430432 credentialStartUrl = startUrl
431433 )
432434 }
0 commit comments