Skip to content

Commit

Permalink
telemetry(amazonq): emit more metrics for code transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hasani committed Nov 1, 2024
1 parent 99099c4 commit f581d2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
12 changes: 1 addition & 11 deletions packages/core/src/codewhisperer/models/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,18 +414,8 @@ export class TransformByQState {
private sourceServerName: string = ''

private metadataPathSQL: string = ''
private linesOfCodeSubmitted: number | undefined = undefined
private sourceDB: DB | undefined = undefined

private targetDB: DB | undefined = undefined

private schema: string = ''

private schemaOptions: Set<string> = new Set()

private sourceServerName: string = ''

private metadataPathSQL: string = ''
private linesOfCodeSubmitted: number | undefined = undefined

private planFilePath: string = ''
private summaryFilePath: string = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,19 +408,14 @@ export class ProposedTransformationExplorer {
const metricsPath = path.join(pathContainingArchive, ExportResultArchiveStructure.PathToMetrics)
const metricsData = JSON.parse(fs.readFileSync(metricsPath, 'utf8'))

console.log('locChanged = ', metricsData.linesOfCodeChanged)
console.log('charsChanged = ', metricsData.charsOfCodeChanged)
console.log('linesSubmitted = ', transformByQState.getLinesOfCodeSubmitted())

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

0 comments on commit f581d2c

Please sign in to comment.