Skip to content

Commit

Permalink
add SQL language type to metric
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hasani committed Nov 1, 2024
1 parent f581d2c commit b840289
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { parsePatch, applyPatches, ParsedDiff } from 'diff'
import path from 'path'
import vscode from 'vscode'
import { ExportIntent } from '@amzn/codewhisperer-streaming'
import { TransformByQReviewStatus, transformByQState } from '../../models/model'
import { TransformationType, TransformByQReviewStatus, transformByQState } from '../../models/model'
import { ExportResultArchiveStructure, downloadExportResultArchive } from '../../../shared/utilities/download'
import { getLogger } from '../../../shared/logger'
import { telemetry } from '../../../shared/telemetry/telemetry'
Expand Down Expand Up @@ -408,14 +408,18 @@ export class ProposedTransformationExplorer {
const metricsPath = path.join(pathContainingArchive, ExportResultArchiveStructure.PathToMetrics)
const metricsData = JSON.parse(fs.readFileSync(metricsPath, 'utf8'))

codeWhisperer.codeWhispererClient.sendTelemetryEvent({
// TO-DO: add support for SQL conversions; right now these metrics are only available for Java upgrades
await codeWhisperer.codeWhispererClient.sendTelemetryEvent({
telemetryEvent: {
transformEvent: {
jobId: transformByQState.getJobId(),
timestamp: new Date(),
ideCategory: 'VSCODE',
programmingLanguage: {
languageName: 'JAVA', // TO-DO: use transformByQState.getTransformationType() to tell if JAVA or SQL
languageName:
transformByQState.getTransformationType() === TransformationType.LANGUAGE_UPGRADE
? 'JAVA'
: 'SQL',
},
linesOfCodeChanged: metricsData.linesOfCodeChanged,
charsOfCodeChanged: metricsData.charsOfCodeChanged,
Expand Down

0 comments on commit b840289

Please sign in to comment.