Skip to content

Commit 01f2f61

Browse files
committed
updates to readme and code review suggestions
1 parent 58fecde commit 01f2f61

File tree

3 files changed

+48
-53
lines changed

3 files changed

+48
-53
lines changed

README.md

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ This application displays a set of charts with various metrics related to GitHub
1111

1212
https://github.com/github-copilot-resources/copilot-metrics-viewer/assets/3329307/bc7e2a16-cc73-43c4-887a-b50809c08533
1313

14-
1514
## Charts
1615

1716
## Key Metrics
@@ -23,30 +22,26 @@ Here are the key metrics visualized in these charts:
2322
<img width="800" alt="image" src="./images/KeyMetrics.png">
2423
</p>
2524

26-
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.
27-
However, as any metric, should be used with caution as developers use Copilot in many different ways (research, confirm, verify etc. not always "inject").
25+
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 with any metric, it should be used with caution as developers use Copilot in many different ways (research, confirm, verify, etc., not always "inject").
2826
<p align="center">
2927
<img width="800" alt="image" src="./images/Acceptance_rate_bycount.png">
3028
</p>
3129

32-
2. **Total Suggestions** This chart illustrates the total number of code suggestions made by GitHub Copilot. It offers a view of the tool's activity and its engagement with users over time.
30+
2. **Total Suggestions:** This chart illustrates the total number of code suggestions made by GitHub Copilot. It offers a view of the tool's activity and its engagement with users over time.
3331

3432
3. **Total Acceptances:** This visualization focuses on the total number of suggestions accepted by users.
35-
3633
<p align="center">
3734
<img width="800" alt="image" src="./images/Total_suggestions_count.png">
3835
</p>
3936

4037
4. **Total Lines Suggested:** Showcases the total number of lines of code suggested by GitHub Copilot. This gives an idea of the volume of code generation and assistance provided.
4138

42-
5. **Total Lines Accepted:** As the name says, the total lines of code accepted by users (full acceptances) offering insights into how much of the suggested code is actually being utilized incorporated to the codebase.
43-
39+
5. **Total Lines Accepted:** As the name suggests, the total lines of code accepted by users (full acceptances) offering insights into how much of the suggested code is actually being utilized and incorporated into the codebase.
4440
<p align="center">
4541
<img width="800" alt="image" src="./images/Total Lines.png">
4642
</p>
4743

4844
6. **Total Active Users:** Represents the number of active users engaging with GitHub Copilot. This helps in understanding the user base growth and adoption rate.
49-
5045
<p align="center">
5146
<img width="800" alt="image" src="./images/Total_Active_users.png">
5247
</p>
@@ -59,7 +54,6 @@ Pie charts with the top 5 languages by accepted prompts and acceptance rate (by
5954
</p>
6055

6156
The language breakdown analysis tab also displays a table showing the Accepted Prompts, Accepted Lines of Code, and Acceptance Rate (%) for each language over the past 28 days. The entries are sorted by the number of _accepted lines of code descending_.
62-
6357
<p align="center">
6458
<img width="800" alt="image" src="./images/Language_breakdown_list.png">
6559
</p>
@@ -74,25 +68,24 @@ The language breakdown analysis tab also displays a table showing the Accepted P
7468

7569
2. **Cumulative Number of Acceptances:** This metric shows the total number of lines of code suggested by Copilot that have been accepted by users over the past 28 days.
7670

77-
3. **Total Turns | Total Acceptances Count:** This is a chart that displays the total number of turns and acceptances
71+
3. **Total Turns | Total Acceptances Count:** This is a chart that displays the total number of turns and acceptances.
7872

79-
4. **Total Active Copilot Chat Users:** a bar chart that illustrates the total number of users who have actively interacted with Copilot over the past 28 days.
73+
4. **Total Active Copilot Chat Users:** A bar chart that illustrates the total number of users who have actively interacted with Copilot over the past 28 days.
8074

8175
## Seat Analysis
8276
<p align="center">
8377
<img width="800" alt="image" src="https://github.com/github-copilot-resources/copilot-metrics-viewer/assets/54096296/51747194-df30-4bfb-8849-54a0510fffcb">
8478
</p>
8579

86-
1. **Total Assigned:** This metric represents the total number of Copilot seats assigned within current organization/enterprise.
80+
1. **Total Assigned:** This metric represents the total number of Copilot seats assigned within the current organization/enterprise.
8781

8882
2. **Assigned But Never Used:** This metric shows seats that were assigned but never used within the current organization/enterprise. The assigned timestamp is also displayed in the chart.
8983

90-
3. **No Activity in the Last 7 days:** never used seats or seats used, but with no activity in the past 7 days.
91-
92-
4. **No Activity in the last 7 days (including never used seats):** a table to display seats that have had no activity in the past 7 days, ordered by the date of last activity. Seats that were used earlier are displayed at the top.
84+
3. **No Activity in the Last 7 Days:** Never used seats or seats used, but with no activity in the past 7 days.
9385

86+
4. **No Activity in the Last 7 Days (including never used seats):** A table to display seats that have had no activity in the past 7 days, ordered by the date of last activity. Seats that were used earlier are displayed at the top.
9487

95-
## Setup instructions
88+
## Setup Instructions
9689

9790
In the `.env` file, you can configure several environment variables that control the behavior of the application.
9891

@@ -108,77 +101,81 @@ For example, if you want to target the API calls to an organization, you would s
108101
````
109102
VUE_APP_SCOPE=organization
110103
111-
VUE_APP_GITHUB_ORG= <YOUR-ORGANIZATION>
104+
VUE_APP_GITHUB_ORG=<YOUR-ORGANIZATION>
112105
113106
VUE_APP_GITHUB_ENT=
114107
````
108+
115109
#### VUE_APP_GITHUB_TEAM
116110

117111
The `VUE_APP_GITHUB_TEAM` environment variable filters metrics for a specific GitHub team within an Enterprise or Organization account.
118112
‼️ Important ‼️ When this variable is set, all displayed metrics will pertain exclusively to the specified team. To view metrics for the entire Organization or Enterprise, remove this environment variable.
119113

120114
````
121115
VUE_APP_GITHUB_TEAM=
122-
123116
````
124117

125118
#### VUE_APP_MOCKED_DATA
126119

127120
To access Copilot metrics from the last 28 days via the API and display actual data, set the following boolean environment variable to `false`:
128121

129-
```
130-
VUE_APP_MOCKED_DATA=false
131-
```
122+
````
123+
VUE_APP_MOCKED_DATA=false
124+
````
132125

133126
#### VUE_APP_GITHUB_TOKEN
127+
134128
Specifies the GitHub Personal Access Token utilized for API requests. Generate this token with the following scopes: _copilot_, _manage_billing:copilot_, _manage_billing:enterprise_, _read:enterprise_, _read:org_.
135129

136-
```
137-
VUE_APP_GITHUB_TOKEN=
138-
```
130+
````
131+
VUE_APP_GITHUB_TOKEN=
132+
````
139133

140-
## Install dependencies
141-
```
134+
## Install Dependencies
135+
136+
```bash
142137
npm install
143138
```
144139

145-
### Compiles and runs the application
146-
```
140+
### Compiles and Runs the Application
141+
142+
```bash
147143
npm run serve
148144
```
149145

150-
### Docker build
151-
```
146+
### Docker Build
147+
148+
```bash
152149
docker build -t copilot-metrics-viewer .
153150
```
154151

155-
### Docker run
156-
```
152+
### Docker Run
153+
154+
```bash
157155
docker run -p 8080:80 --env-file ./.env copilot-metrics-viewer
158156
```
157+
159158
The application will be accessible at http://localhost:8080
160159

161160
## Running with API Proxy
162161

163-
Project can run with an API proxy which hides GitHub tokens and is secure enough to be deployed.
164-
Api Proxy project is in `\api` directory. Vue app makes the calls to `/api/github` which then are proxied to `https://api.github.com` with appropriate bearer token.
165-
166-
Proxy can authenticate user using GitHub App. In order to do that, following environment variables are required:
162+
The project can run with an API proxy which hides GitHub tokens and is secure enough to be deployed.
163+
The API Proxy project is in the `\api` directory. The Vue app makes the calls to `/api/github` which are then proxied to `https://api.github.com` with the appropriate bearer token.
167164

168-
* `GITHUB_CLIENT_ID` - client Id of the GitHub App registered and installed in the enterprise/org with permissions listed above.
169-
* `GITHUB_CLIENT_SECRET` - client secret of the GitHub App
170-
* `SESSION_SECRET` - random string for securing session state
165+
The proxy can authenticate the user using a GitHub App. In order to do that, the following environment variables are required:
171166

172-
If you want use a custom path for your `.env` file you can set the environment variable `DOTENV_CONFIG_PATH`.
167+
* `GITHUB_CLIENT_ID` - client ID of the GitHub App registered and installed in the enterprise/org with permissions listed above.
168+
* `GITHUB_CLIENT_SECRET` - client secret of the GitHub App.
169+
* `SESSION_SECRET` - random string for securing session state.
173170

174-
https://github.com/user-attachments/assets/e5596067-da9c-409d-9b9f-0a688cc1f2c4
171+
If you want to use a custom path for your `.env` file, you can set the environment variable `DOTENV_CONFIG_PATH`.
175172

176-
It's also possible to run with **PAT Token**, see examples below for required variables.
173+
It's also possible to run with a **PAT Token**, see examples below for required variables.
177174

178-
For local development register `http://localhost:3000/callback` as GH App callback Uri.
179-
For deployed version use the Uri of your app.
175+
For local development, register `http://localhost:3000/callback` as the GitHub App callback URI.
176+
For the deployed version, use the URI of your app.
180177

181-
To build and run the app with API proxy:
178+
To build and run the app with the API proxy:
182179

183180
```bash
184181
docker build -t copilot-metrics-viewer-with-proxy -f api.Dockerfile .
@@ -190,7 +187,7 @@ To run:
190187
docker run -it --rm -p 8080:3000 --env-file ./.env copilot-metrics-viewer-with-proxy
191188
```
192189

193-
Or with custom path for your `.env` file:
190+
Or with a custom path for your `.env` file:
194191

195192
```bash
196193
docker run -it --rm -p 8080:3000 \
@@ -199,7 +196,7 @@ docker run -it --rm -p 8080:3000 \
199196
copilot-metrics-viewer-with-proxy
200197
```
201198

202-
Proxy can also run with token hardcoded on the backend (which hides it from frontend calls), here's a sample:
199+
The proxy can also run with the token hardcoded on the backend (which hides it from frontend calls), here's a sample:
203200

204201
```bash
205202
docker run -it --rm -p 3000:3000 \
@@ -233,6 +230,6 @@ This project is licensed under the terms of the MIT open source license. Please
233230

234231
## Support
235232

236-
This project is independently developed and maintained, and is not an official GitHub product. It thrives through the dedicated efforts of ([@martedesco](https://github.com/martedesco)), ([@karpikpl](https://github.com/karpikpl)) our wonderful contributors. A heartfelt thanks to all our contributors! ✨
233+
This project is independently developed and maintained, and is not an official GitHub product. It thrives through the dedicated efforts of ([@martedesco](https://github.com/martedesco)), ([@karpikpl](https://github.com/karpikpl)) and our wonderful contributors. A heartfelt thanks to all our contributors! ✨
237234

238235
I aim to provide support through [GitHub Issues](https://github.com/github-copilot-resources/copilot-metrics-viewer/issues). While I strive to stay responsive, I can't guarantee immediate responses. For critical issues, please include "CRITICAL" in the title for quicker attention. 🙏🏼

src/components/ApiResponse.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { defineComponent } from 'vue';
3535
import config from '../config';
3636
import { MetricsValidator } from '../api/MetricsValidator';
3737
import { CopilotMetrics } from '../model/Copilot_Metrics';
38+
import { Metrics } from '@/model/Metrics';
3839
3940
export default defineComponent({
4041
name: 'ApiResponse',
@@ -44,7 +45,7 @@ export default defineComponent({
4445
required: true
4546
},
4647
metrics: {
47-
type: Array as () => CopilotMetrics[],
48+
type: Array as () => Metrics[],
4849
required: true
4950
},
5051
seats: {
@@ -109,7 +110,7 @@ export default defineComponent({
109110
this.message = 'All metrics are valid!';
110111
this.isError = false;
111112
} else {
112-
this.message = 'Some metrics maybe are invalid, pls double check!\n';
113+
this.message = 'Some metrics might be inconsistent, please double check the API response.\n';
113114
this.isError = true;
114115
let typeCounter = 1;
115116
for (const [key, value] of Object.entries(results)) {

src/components/BreakdownComponent.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ export default defineComponent({
210210
// console.log('Breakdown:', breakdown);
211211
}));
212212
213-
// for test, it seems there is an issue in data, so need to get the data in console
214-
console.log('Breakdown List:', JSON.stringify(breakdownList.value, null, 2));
215-
216213
//Sort breakdowns map by accepted prompts
217214
breakdownList.value.sort((a, b) => b.acceptedPrompts - a.acceptedPrompts);
218215

0 commit comments

Comments
 (0)