Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

telemetry: Metrics for amazonq unit test generation #905

Closed
wants to merge 14 commits into from

Conversation

laileni-aws
Copy link
Contributor

@laileni-aws laileni-aws commented Nov 10, 2024

Problem

  • No metrics for amazonq unit test generation

Solution

Planning to add 4 metrics for Unit test generation.

  1. amazonq_unitTestGeneration(new)
  2. amazonq_utg_generateTests(new)
  3. amazonq_utg_buildLoop(new)
  4. ui_click(existing)
  • Planning to add a new optional field (step) to ui_click to get metrics on which stage user has clicked a button.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@laileni-aws laileni-aws marked this pull request as ready for review November 11, 2024 16:39
@laileni-aws laileni-aws requested a review from a team as a code owner November 11, 2024 16:39
Comment on lines 1500 to 1514
{
"name": "numberOfBuildExecuted",
"type": "int",
"description": "Number of build executed in unit test generation build loop"
},
{
"name": "numberOfBuildFailed",
"type": "int",
"description": "Number of build failures in unit test generation build loop"
},
{
"name": "numberOfBuildPassed",
"type": "int",
"description": "Number of build succeeded in unit test generation build loop"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are already some generic "successCount" and similar fields. use those. if you need to add a executedCount or something like that, that is preferred.

do not add over-specific fields for every metric.

Comment on lines 1516 to 1522
"name": "numberOfUnitTestCasesAccepted",
"type": "int",
"description": "Number of unit test cases accepted"
},
{
"name": "numberOfUnitTestCasesGenerated",
"type": "int",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use or create generic fooCount metrics.

please always do this in the future. I have mentiond this in previous reviews.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Named these two fields to commonacceptedCount and generatedCount.

Comment on lines 1749 to 1752
"name": "supportedLanguage",
"type": "boolean",
"description": "supported language"
},
Copy link
Contributor

@justinmk3 justinmk3 Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are multiple such fields already. do not add redundant fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see a field which checks the supported language(boolean).
LMK If I am missing something.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field should be isSupportedLanguage to indicate it is boolean field. SupportedLanguage seems like we are going to pass the actual value of language which could be string/enum type.

Also the comment should be "Indicate if the language is supported"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not see convention naming isXXXX for boolean values in the json file so for keeping consistent went with supportedLanguage
Let me change this accordingly

Copy link
Contributor

@justinmk3 justinmk3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs more thought. In the future, please do not propose changes without first looking for fields/metrics that can be re-used.

Comment on lines 1456 to 1461
"name": "linesOfCodeAccepted",
"type": "int",
"description": "Number of lines of code accepted"
},
{
"name": "linesOfCodeGenerated",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you really need to track chars and lines? how is that the existing codewhisperer metrics don't already have fields for this?

Suggested change
"name": "linesOfCodeAccepted",
"type": "int",
"description": "Number of lines of code accepted"
},
{
"name": "linesOfCodeGenerated",
"name": "acceptedLinesCount",
"type": "int",
"description": "Number of lines of code accepted"
},
{
"name": "generatedLinesCount",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are using cwsprChatAcceptedNumberOfLines which is specific name not generic but trying to use the same.

Comment on lines 1753 to 1758
"name": "testGenerationJobGroupName",
"type": "string",
"description": "Unit test generation job group name"
},
{
"name": "testGenerationJobId",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a group name and job id could be used in many metrics. please do not add hyper-specific fields for every metric.

I already see fields like codeTransformJobId, and that's another case where we're paying the price for those fields being over-specific.

Suggested change
"name": "testGenerationJobGroupName",
"type": "string",
"description": "Unit test generation job group name"
},
{
"name": "testGenerationJobId",
"name": "jobGroup",
"type": "string",
"description": "Job group name associated with the metric"
},
{
"name": "jobId",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update with this

@laileni-aws laileni-aws changed the title Metrics for amazonq unit test generation telemetry: Metrics for amazonq unit test generation Nov 15, 2024
@laileni-aws laileni-aws deleted the telemetry branch November 27, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants