Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -146,7 +146,7 @@ interface CodeWhispererClientAdaptor : Disposable {
sessionId: String,
requestId: String,
language: CodeWhispererProgrammingLanguage,
customizationArn: String,
customizationArn: String?,
acceptedCharacterCount: Int,
unmodifiedAcceptedTokenCount: Int,
): SendTelemetryEventResponse
Expand Down Expand Up @@ -427,7 +427,11 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
it.timestamp(Instant.now())
it.suggestionReferenceCount(suggestionReferenceCount)
it.generatedLine(lineCount)
it.customizationArn(requestContext.customizationArn)
requestContext.customizationArn?.let { arn ->
if (arn.isNotBlank()) {
it.customizationArn(arn)
}
}
it.numberOfRecommendations(numberOfRecommendations)
it.acceptedCharacterCount(acceptedCharCount)
}
Expand Down Expand Up @@ -473,7 +477,11 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
it.timestamp(Instant.now())
it.suggestionReferenceCount(suggestionReferenceCount)
it.generatedLine(lineCount)
it.customizationArn(requestContext.customizationArn)
requestContext.customizationArn?.let { arn ->
if (arn.isNotBlank()) {
it.customizationArn(arn)
}
}
it.numberOfRecommendations(numberOfRecommendations)
it.acceptedCharacterCount(acceptedCharCount)
}
Expand All @@ -495,7 +503,11 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
requestBuilder.telemetryEvent { telemetryEventBuilder ->
telemetryEventBuilder.codeCoverageEvent {
it.programmingLanguage { languageBuilder -> languageBuilder.languageName(language.toCodeWhispererRuntimeLanguage().languageId) }
it.customizationArn(customizationArn)
customizationArn?.let { arn ->
if (arn.isNotBlank()) {
it.customizationArn(arn)
}
}
it.acceptedCharacterCount(acceptedTokenCount.toInt())
it.totalCharacterCount(totalTokenCount.toInt())
it.timestamp(Instant.now())
Expand All @@ -512,7 +524,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
sessionId: String,
requestId: String,
language: CodeWhispererProgrammingLanguage,
customizationArn: String,
customizationArn: String?,
acceptedCharacterCount: Int,
unmodifiedAcceptedTokenCount: Int,
): SendTelemetryEventResponse = bearerClient().sendTelemetryEvent { requestBuilder ->
Expand All @@ -523,7 +535,11 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
it.programmingLanguage { languageBuilder ->
languageBuilder.languageName(language.toCodeWhispererRuntimeLanguage().languageId)
}
it.customizationArn(customizationArn)
customizationArn?.let { arn ->
if (arn.isNotBlank()) {
it.customizationArn(arn)
}
}
// deprecated field, service side should not use this % anymore
it.modificationPercentage(0.0)
it.timestamp(Instant.now())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class CodeWhispererUserModificationTracker(private val project: Project) : Dispo
suggestion.sessionId,
suggestion.requestId,
CodeWhispererLanguageManager.getInstance().getLanguage(suggestion.vFile),
CodeWhispererModelConfigurator.getInstance().activeCustomization(project)?.arn.orEmpty(),
CodeWhispererModelConfigurator.getInstance().activeCustomization(project)?.arn,
suggestion.suggestion.length,
getUnmodifiedAcceptedCharsCount(suggestion.suggestion, modifiedSuggestion)
)
Expand Down
Loading