Skip to content

Commit

Permalink
Merge pull request #14 from github-copilot-community/feature/language…
Browse files Browse the repository at this point in the history
…s-breakdown-enhancements

Feature/languages breakdown enhancements
  • Loading branch information
martedesco committed Apr 17, 2024
2 parents 9540792 + 81ff6b4 commit 9d08cf8
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VUE_APP_MOCKED_DATA=true

VUE_APP_GITHUB_ORG=
VUE_APP_GITHUB_ORG=octodemo

VUE_APP_GITHUB_TOKEN=
50 changes: 25 additions & 25 deletions src/assets/copilot_metrics_response_sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"total_lines_suggested": 35290,
"total_lines_accepted": 5038,
"total_active_users": 97,
"total_chat_acceptances": 174,
"total_chat_turns": 119,
"total_chat_acceptances": 157,
"total_chat_turns": 190,
"total_active_chat_users": 38,
"breakdown": [
{
Expand Down Expand Up @@ -957,7 +957,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 149,
"total_chat_acceptances": 151,
"total_chat_turns": 168,
"total_active_chat_users": 7
},
Expand Down Expand Up @@ -1510,7 +1510,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 182,
"total_chat_acceptances": 12,
"total_chat_turns": 43,
"total_active_chat_users": 6
},
Expand Down Expand Up @@ -2054,7 +2054,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 57,
"total_chat_acceptances": 27,
"total_chat_turns": 43,
"total_active_chat_users": 187
},
Expand Down Expand Up @@ -2391,7 +2391,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 180,
"total_chat_acceptances": 93,
"total_chat_turns": 196,
"total_active_chat_users": 146
},
Expand Down Expand Up @@ -2755,7 +2755,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 161,
"total_chat_acceptances": 21,
"total_chat_turns": 88,
"total_active_chat_users": 141
},
Expand Down Expand Up @@ -3227,7 +3227,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 71,
"total_chat_acceptances": 142,
"total_chat_turns": 159,
"total_active_chat_users": 53
},
Expand Down Expand Up @@ -3780,7 +3780,7 @@
"active_users": 1
}
],
"total_chat_acceptances": 118,
"total_chat_acceptances": 53,
"total_chat_turns": 192,
"total_active_chat_users": 34
},
Expand Down Expand Up @@ -4387,7 +4387,7 @@
"active_users": 1
}
],
"total_chat_acceptances": 132,
"total_chat_acceptances": 16,
"total_chat_turns": 36,
"total_active_chat_users": 162
},
Expand Down Expand Up @@ -4985,7 +4985,7 @@
"active_users": 3
}
],
"total_chat_acceptances": 108,
"total_chat_acceptances": 68,
"total_chat_turns": 118,
"total_active_chat_users": 5
},
Expand Down Expand Up @@ -5286,7 +5286,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 39,
"total_chat_acceptances": 46,
"total_chat_turns": 96,
"total_active_chat_users": 9
},
Expand Down Expand Up @@ -5623,7 +5623,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 125,
"total_chat_acceptances": 14,
"total_chat_turns": 19,
"total_active_chat_users": 54
},
Expand Down Expand Up @@ -6059,7 +6059,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 42,
"total_chat_acceptances": 142,
"total_chat_turns": 194,
"total_active_chat_users": 44
},
Expand Down Expand Up @@ -6567,7 +6567,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 11,
"total_chat_acceptances": 23,
"total_chat_turns": 37,
"total_active_chat_users": 90
},
Expand Down Expand Up @@ -7030,7 +7030,7 @@
"active_users": 1
}
],
"total_chat_acceptances": 11,
"total_chat_acceptances": 27,
"total_chat_turns": 160,
"total_active_chat_users": 131
},
Expand Down Expand Up @@ -7574,7 +7574,7 @@
"active_users": 1
}
],
"total_chat_acceptances": 15,
"total_chat_acceptances": 1,
"total_chat_turns": 16,
"total_active_chat_users": 45
},
Expand Down Expand Up @@ -7893,7 +7893,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 102,
"total_chat_acceptances": 4,
"total_chat_turns": 22,
"total_active_chat_users": 115
},
Expand Down Expand Up @@ -8257,7 +8257,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 194,
"total_chat_acceptances": 123,
"total_chat_turns": 140,
"total_active_chat_users": 58
},
Expand Down Expand Up @@ -8837,7 +8837,7 @@
"active_users": 1
}
],
"total_chat_acceptances": 125,
"total_chat_acceptances": 52,
"total_chat_turns": 178,
"total_active_chat_users": 199
},
Expand Down Expand Up @@ -9453,7 +9453,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 134,
"total_chat_acceptances": 104,
"total_chat_turns": 146,
"total_active_chat_users": 136
},
Expand Down Expand Up @@ -9961,7 +9961,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 55,
"total_chat_acceptances": 24,
"total_chat_turns": 108,
"total_active_chat_users": 10
},
Expand Down Expand Up @@ -10433,7 +10433,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 7,
"total_chat_acceptances": 39,
"total_chat_turns": 43,
"total_active_chat_users": 99
},
Expand Down Expand Up @@ -10851,7 +10851,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 104,
"total_chat_acceptances": 130,
"total_chat_turns": 132,
"total_active_chat_users": 173
},
Expand Down Expand Up @@ -11053,7 +11053,7 @@
"active_users": 2
}
],
"total_chat_acceptances": 92,
"total_chat_acceptances": 102,
"total_chat_turns": 143,
"total_active_chat_users": 142
}
Expand Down
22 changes: 0 additions & 22 deletions src/components/AppHeader.vue

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/CopilotChatViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<v-card-item>
<div>
<div class="text-overline mb-1" style="visibility: hidden;">filler</div>
<div class="text-h6 mb-1">Cumulative Number of Lines of Code Accepted</div>
<div class="text-h6 mb-1">Cumulative Number of Acceptances</div>
<div class="text-caption">
Over the last 28 days
</div>
Expand All @@ -33,7 +33,7 @@

<v-container style="min-height: 300px;" class="px-4 elevation-2">

<h2>Total Suggestions Count | Total Acceptances Count</h2>
<h2>Total Acceptances | Total Turns Count</h2>
<Line :data="totalNumberAcceptancesAndTurnsChartData" :options="chartOptions" />

<h2>Total Active Copilot Chat Users</h2>
Expand Down
57 changes: 27 additions & 30 deletions src/components/LanguagesBreakdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,31 @@
<v-main class="p-1" style="min-height: 300px;">

<v-container style="min-height: 300px;" class="px-4 elevation-2">
<v-card>
<v-card-item class="d-flex justify-center align-center">
<div class="text-overline mb-1" style="visibility: hidden;">filler</div>
<div class="text-h6 mb-1">Top 5 languages by accepted prompts</div>
<div style="width: 300px; height: 300px;" >
<Pie :data="languagesChartDataTop5AcceptedPrompts" :options="chartOptions" />
</div>
</v-card-item>
</v-card>
<v-row>
<v-col cols="6">
<v-card>
<v-card-item class="d-flex justify-center align-center">
<div class="text-overline mb-1" style="visibility: hidden;">filler</div>
<div class="text-h6 mb-1">Top 5 languages by accepted prompts</div>
<div style="width: 300px; height: 300px;">
<Pie :data="languagesChartDataTop5AcceptedPrompts" :options="chartOptions" />
</div>
</v-card-item>
</v-card>
</v-col>

<v-card>
<v-card-item class="d-flex justify-center align-center">
<div class="text-overline mb-1" style="visibility: hidden;">filler</div>
<div class="text-h6 mb-1">Top 5 languages by acceptance rate</div>
<div style="width: 300px; height: 300px;" >
<Pie :data="languagesChartDataTop5AcceptanceRate" :options="chartOptions" />
</div>
</v-card-item>
</v-card>
<v-col cols="6">
<v-card>
<v-card-item class="d-flex justify-center align-center">
<div class="text-overline mb-1" style="visibility: hidden;">filler</div>
<div class="text-h6 mb-1">Top 5 languages by acceptance rate</div>
<div style="width: 300px; height: 300px;">
<Pie :data="languagesChartDataTop5AcceptanceRate" :options="chartOptions" />
</div>
</v-card-item>
</v-card>
</v-col>
</v-row>

<br>
<h2>Languages Breakdown </h2>
Expand Down Expand Up @@ -112,7 +118,6 @@
};
},
setup() {
console.log('LanguagesBreakdown setup');
const metrics = ref<Metrics[]>([]);
Expand Down Expand Up @@ -172,7 +177,6 @@
yield* [...this.entries()].sort((a, b) => b[1].acceptanceRate - a[1].acceptanceRate);
}
// Get the top 5 languages by acceptance rate
const top5LanguagesAcceptanceRate = new Map([...languages.value].slice(0, 5));
Expand All @@ -184,7 +188,7 @@
datasets: [
{
data: Array.from(top5LanguagesAcceptanceRate.values()).map(language => language.acceptanceRate.toFixed(2)),
backgroundColor: ['#41B883', '#E46651', '#00D8FF', '#DD1B16'],
backgroundColor: ['#41B883', '#E46651', '#00D8FF', '#DD1B16', '#FFD700', '#FF69B4', '#D8BFD8', '#DDA0DD', '#EE82EE', '#DA70D6', '#BA55D3', '#9370DB', '#8A2BE2', '#9400D3'],
},
],
};
Expand All @@ -199,7 +203,7 @@
datasets: [
{
data: Array.from(languages.value.values()).map(language => language.acceptedPrompts),
backgroundColor: ['#41B883', '#E46651', '#00D8FF', '#DD1B16'],
backgroundColor: ['#41B883', '#E46651', '#00D8FF', '#DD1B16', '#FFD700', '#FF69B4', '#D8BFD8', '#DDA0DD', '#EE82EE', '#DA70D6', '#BA55D3', '#9370DB', '#8A2BE2', '#9400D3'],
},
],
};
Expand All @@ -212,19 +216,12 @@
datasets: [
{
data: Array.from(top5LanguagesAcceptedPrompts.values()).map(language => language.acceptedPrompts),
backgroundColor: ['#41B883', '#E46651', '#00D8FF', '#DD1B16'],
backgroundColor: ['#41B883', '#E46651', '#00D8FF', '#DD1B16', '#FFD700', '#FF69B4', '#D8BFD8', '#DDA0DD', '#EE82EE', '#DA70D6', '#BA55D3', '#9370DB', '#8A2BE2', '#9400D3'],
},
],
};
numberOfLanguages.value = languages.value.size;
console.log("Number of languages: " + numberOfLanguages.value);
console.log("LanguagesChartData: " + JSON.stringify(languagesChartData));
}).catch(error => {
console.log(error);
Expand Down

0 comments on commit 9d08cf8

Please sign in to comment.