-
Notifications
You must be signed in to change notification settings - Fork 274
#122 Feature/new copilot metrics---update to latest metrics API, repalce the old usage API #125
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
#122 Feature/new copilot metrics---update to latest metrics API, repalce the old usage API #125
Conversation
…ons bug for acceptance rate (by lines); remove unused variables in SeatsAnalysisViewer
… sources for top 5 accepted prompts
…te labels, improve clarity, and reorder cards for better focus on acceptance rates by count
… enhance error handling and improve code readability
…age paths for key metrics
…/DevOps-zhuang/copilot-metrics-viewer into Feature/AddAcceptanceRatebycount
…the old one is called metrics
…usage route 2) add MetricsToUsageConverter class, to map the new returned metrics schedma to old metrics schema, so the caller don't need to update more. 3) add CopilotUsageChecker to check the data quality of the new fetched schema, and display it in api-response page.
…re, simplify the button layout in the ApiResponse component.
[like] Junqian Zhuang reacted to your message:
…________________________________
From: Massimo Gentilini ***@***.***>
Sent: Thursday, December 5, 2024 9:32:34 AM
To: github-copilot-resources/copilot-metrics-viewer ***@***.***>
Cc: Junqian Zhuang ***@***.***>; Author ***@***.***>
Subject: Re: [github-copilot-resources/copilot-metrics-viewer] #122 Feature/new copilot metrics---update to latest metrics API, repalce the old usage API (PR #125)
Tested on my installation with my data, some feedbacks:
* New breakdown: really useful, but in my scenario the colors of the pie is too similar
image.png (view on web)<https://github.com/user-attachments/assets/8fdf21f9-eb8f-42ee-9b0c-b78579f39806>
* API analysis, good but from my point of view this error is quite normal because it's normal to do not have data during weekends or festivities. Very minor one indeed, maybe improving the message (do not over analyze them to consider non working days because it's a mess)
Some metrics are invalid! nonContinuousDates: [ "2024-11-10", "2024-11-26", "2024-11-30" ]
* In the main page the first two graphs are larger than the other ones, not nice to see.
image.png (view on web)<https://github.com/user-attachments/assets/6482a638-5435-4a4c-9e8f-695e2522b0f4>
—
Reply to this email directly, view it on GitHub<#125 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM4XDKAMYAANCDVP6HIFJF32EAMTFAVCNFSM6AAAAABSWRGQFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJZG42DSMJWGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
…der positions and container structure.
…alid metrics output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 18 out of 28 changed files in this pull request and generated 1 comment.
Files not reviewed (10)
- src/assets/enterprise_seats_response_sample.json: Language not supported
- src/assets/organization_seats_response_sample.json: Language not supported
- src/components/SeatsAnalysisViewer.vue: Evaluated as low risk
- src/components/ApiResponse.vue: Evaluated as low risk
- src/components/BreakdownComponent.vue: Evaluated as low risk
- src/components/MainComponent.vue: Evaluated as low risk
- src/components/MetricsViewer.vue: Evaluated as low risk
- src/api/MetricsValidator.ts: Evaluated as low risk
- src/model/Breakdown.ts: Evaluated as low risk
- src/model/Copilot_Metrics.ts: Evaluated as low risk
const totalChatCopies = metric.copilot_ide_chat?.editors?.reduce((sum, editor) => | ||
sum + editor.models?.reduce((sum, model) => sum + model.total_chat_copy_events, 0), 0) || 0; | ||
|
||
console.log(`Date: ${metric.date}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console logs should be removed or replaced with proper logging mechanisms.
Copilot uses AI. Check for mistakes.
// Get the top 5 breakdowns by acceptance rate | ||
const top5BreakdownsAcceptanceRate = breakdownList.value.slice(0, 5); | ||
// for test, it seems there is an issue in data, so need to get the data in console | ||
console.log('Breakdown List:', JSON.stringify(breakdownList.value, null, 2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this line still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not needed now, the issue is fixed. in the past, it didn't refresh
<img width="800" alt="image" src="./images/KeyMetrics.png"> | ||
</p> | ||
|
||
1. **Acceptance Rate:** This metric represents the ratio of accepted numbers to the total numbers suggested by GitHub Copilot. This rate is an indicator of the relevance and usefulness of Copilot's suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. **Acceptance Rate:** This metric represents the ratio of accepted numbers to the total numbers suggested by GitHub Copilot. This rate is an indicator of the relevance and usefulness of Copilot's suggestions. | |
1. **Acceptance Rate:** This metric represents the ratio of accepted lines and suggestions to the total suggested by GitHub Copilot. This rate is an indicator of the relevance and usefulness of Copilot's suggestions. | |
However, as any metric, should be used with caution as developers use Copilot in many different ways (research, confirm, verify etc. not always "inject"). |
@@ -15,45 +15,49 @@ https://github.com/github-copilot-resources/copilot-metrics-viewer/assets/332930 | |||
## Charts | |||
|
|||
## Key Metrics | |||
Here are the key metrics visualized in these charts: | |||
1. **Acceptance Rate:** This metric represents the ratio of accepted lines to the total lines suggested by GitHub Copilot. This rate is an indicator of the relevance and usefulness of Copilot's suggestions. | |||
Here are the key metrics visualized in these charts,will introduce them one by one as below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the key metrics visualized in these charts,will introduce them one by one as below | |
>[!NOTE] | |
> Metrics details are described in detail in [GitHub API response schema](https://docs.github.com/en/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-organization) | |
Here are the key metrics visualized in these charts: |
required: true | ||
}, | ||
metrics: { | ||
type: Array as () => CopilotMetrics[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: Array as () => CopilotMetrics[], | |
type: Array as () => Metrics[], |
</v-container> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import config from '../config'; | ||
import { MetricsValidator } from '../api/MetricsValidator'; | ||
import { CopilotMetrics } from '../model/Copilot_Metrics'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { CopilotMetrics } from '../model/Copilot_Metrics'; | |
import { CopilotMetrics } from '../model/Copilot_Metrics'; | |
import { Metrics } from '@/model/Metrics'; |
@DevOps-zhuang - from what I can tell this also contains #116 and #115 which fixes #113 ? |
yes,it is a latest version
获取 Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
发件人: Piotr Karpala ***@***.***>
发送时间: Sunday, January 5, 2025 1:49:08 PM
收件人: github-copilot-resources/copilot-metrics-viewer ***@***.***>
抄送: Junqian Zhuang ***@***.***>; Mention ***@***.***>
主题: Re: [github-copilot-resources/copilot-metrics-viewer] #122 Feature/new copilot metrics---update to latest metrics API, repalce the old usage API (PR #125)
@DevOps-zhuang<https://github.com/DevOps-zhuang> - from what I can tell this also contains #116<#116> and #115<#115> which fixes #113<#113> ?
―
Reply to this email directly, view it on GitHub<#125 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM4XDKHMO2VFNV2ZOMEL7LL2JDBVJAVCNFSM6AAAAABSWRGQFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZRGUYTCNRQHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
this.message = 'All metrics are valid!'; | ||
this.isError = false; | ||
} else { | ||
this.message = 'Some metrics maybe are invalid, pls double check!\n'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.message = 'Some metrics maybe are invalid, pls double check!\n'; | |
this.message = 'Some metrics might be inconsistent, please double check the API response.\n'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the API update! I've posted some code suggestions
// for test, it seems there is an issue in data, so need to get the data in console | ||
console.log('Breakdown List:', JSON.stringify(breakdownList.value, null, 2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// for test, it seems there is an issue in data, so need to get the data in console | |
console.log('Breakdown List:', JSON.stringify(breakdownList.value, null, 2)); |
this has been replaced by #138 which included all the code changes + tests. |
[heart] Junqian Zhuang reacted to your message:
…________________________________
From: Piotr Karpala ***@***.***>
Sent: Saturday, January 11, 2025 7:44:34 AM
To: github-copilot-resources/copilot-metrics-viewer ***@***.***>
Cc: Junqian Zhuang ***@***.***>; Mention ***@***.***>
Subject: Re: [github-copilot-resources/copilot-metrics-viewer] #122 Feature/new copilot metrics---update to latest metrics API, repalce the old usage API (PR #125)
this has been replaced by #138<#138> which included all the code changes + tests.
Thanks @DevOps-zhuang<https://github.com/DevOps-zhuang> !
—
Reply to this email directly, view it on GitHub<#125 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM4XDKH47Y3HFRO4PFU3LJL2KDDWFAVCNFSM6AAAAABSWRGQFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBVGEZTKMRQGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
…ilot-metrics Feature/new copilot metrics API - replaces #125
#122
This pull request includes various changes aimed at enhancing the metrics visualization and data validation for GitHub Copilot. The most important changes include updates to the
README.md
file, refactoring the API calls and data handling, adding a new data conversion utility, and implementing a metrics validator. Additionally, there are updates to the Vue components to improve the display and interaction with the metrics data.Documentation Updates:
README.md
: Updated image sources and restructured the key metrics section for better clarity and presentation.API and Data Handling Improvements:
src/api/GitHubApi.ts
: Refactored the API calls to handle Copilot metrics, including ensuring data structure consistency and converting metrics data for usage. [1] [2] [3] [4]src/api/MetricsToUsageConverter.ts
: Added a new utility to convert Copilot metrics to a structured format suitable for usage analysis.src/api/MetricsValidator.ts
: Implemented a validator class to check for continuous dates, validate code completions, and chat engaged users in the metrics data.Frontend Enhancements:
src/components/ApiResponse.vue
: Enhanced the component to include a button for checking metrics data quality and updated the display logic for metrics and seats data. [1] [2] [3]src/components/BreakdownComponent.vue
: Updated the component to include new breakdown charts and additional data columns for suggested prompts and acceptance rates by count and lines. [1] [2] [3] [4]