574400 AI User Metrics
What does this MR do and why?
Expanding on AI Metrics we provide for user
Technical changes:
- Refactors
AiUserMetricsServiceto use a single ClickHouse query with dynamic filtering - Updates GraphQL type to dynamically generate fields for all AI tracking events
- Implements lookahead optimization to query only requested metrics
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
query getUserAiUserMetrics(
$fullPath: ID!
$startDate: Date!
$endDate: Date!
) {
group(fullPath: $fullPath) {
id
aiUserMetrics(
startDate: $startDate
endDate: $endDate
) {
nodes {
user {
id
name
username
avatarUrl
webUrl
lastDuoActivityOn
}
codeSuggestionsAcceptedCount
duoChatInteractionsCount
codeSuggestionRejectedInIdeCount
codeSuggestionsRequestedCount
troubleshootJobCount
agentPlatformSessionCreatedCount
agentPlatformSessionStartedCount
agentPlatformSessionFinishedCount
agentPlatformSessionDroppedCount
agentPlatformSessionStoppedCount
encounterDuoCodeReviewErrorDuringReviewCount
findNoIssuesDuoCodeReviewAfterReviewCount
findNothingToReviewDuoCodeReviewOnMrCount
postCommentDuoCodeReviewOnDiffCount
reactThumbsUpOnDuoCodeReviewCommentCount
reactThumbsDownOnDuoCodeReviewCommentCount
requestReviewDuoCodeReviewOnMrByAuthorCount
requestReviewDuoCodeReviewOnMrByNonAuthorCount
excludedFilesFromDuoCodeReviewCount
}
}
}
}
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #574400
Edited by Amr Taha