Skip to content

Commit

Permalink
Status Chart: Remove Average Age, update timeframes (#4399)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej authored Feb 29, 2024
1 parent d966086 commit 576b598
Show file tree
Hide file tree
Showing 8 changed files with 1,850 additions and 1,831 deletions.
2 changes: 1 addition & 1 deletion built/status_chart.mjs

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>STL Status Chart</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@primer/css@21.1.1/dist/primer.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@primer/css@21.2.0/dist/primer.min.css" />
<script type="importmap">
{ "imports": {
"@kurkle/color": "https://cdn.jsdelivr.net/npm/@kurkle/color@0.3.2/dist/color.esm.min.js",
Expand Down Expand Up @@ -115,12 +115,6 @@ <h1 id="age">Pull Request Age</h1>

<h2>Explanation</h2>
<ul>
<li>Left axis:
<ul>
<li><span class="Counter Counter--primary" id="currentValue-avg_age"></span>
The average age of open pull requests, in days.</li>
</ul>
</li>
<li>Right axis:
<ul>
<li><span class="Counter"
Expand Down
353 changes: 195 additions & 158 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
"dependencies": {
"@octokit/graphql": "^7.0.2",
"@types/cli-progress": "^3.11.5",
"@types/luxon": "^3.4.0",
"@types/node": "^20.11.0",
"@types/luxon": "^3.4.2",
"@types/node": "^20.11.20",
"@types/yargs": "^17.0.32",
"chart.js": "^4.4.1",
"chartjs-adapter-luxon": "^1.3.1",
"cli-progress": "^3.12.0",
"dotenv": "^16.3.1",
"esbuild": "^0.19.11",
"dotenv": "^16.4.5",
"esbuild": "^0.20.1",
"http-server": "^14.1.1",
"luxon": "^3.4.4",
"typescript": "^5.3.3",
Expand Down
3,277 changes: 1,638 additions & 1,639 deletions src/daily_table.ts

Large diffs are not rendered by default.

23 changes: 5 additions & 18 deletions src/status_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function load_charts() {
new DatasetInfo('issue', 'GitHub Issues', 'largeAxis', '--color-neutral-emphasis', true),
new DatasetInfo('libcxx', 'Skipped Libcxx Tests', 'largeAxis', '--color-attention-emphasis'),

new DatasetInfo('avg_age', 'Average Age', 'leftAxis', '--color-neutral-emphasis', true),
new DatasetInfo('sum_age', 'Combined Age', 'rightAxis', '--color-fg-default'),

new DatasetInfo('merged', 'Line: Sliding Window', 'mergeAxis', '--color-accent-emphasis'),
Expand Down Expand Up @@ -203,10 +202,6 @@ function load_charts() {

const age_data = {
datasets: [
{
data: get_daily_values('avg_age'),
...get_dataset_properties('avg_age'),
},
{
data: get_daily_values('sum_age'),
...get_dataset_properties('sum_age'),
Expand Down Expand Up @@ -248,6 +243,10 @@ function load_charts() {
},
{
min: '2022-01-01',
time: { unit: 'year' },
},
{
min: '2023-01-01',
time: { unit: 'quarter' },
},
];
Expand Down Expand Up @@ -393,7 +392,6 @@ function load_charts() {
...make_common_options(),
scales: {
x: make_xAxis(timeframes[timeframe_github_idx]),
leftAxis: make_yAxis('left', 'Average (days)', 0, 500, 100),
rightAxis: make_yAxis('right', 'Combined (PR-months)', 0, 500, 100),
},
};
Expand Down Expand Up @@ -526,18 +524,7 @@ function load_charts() {
update_all_timeframes();
});

const daily_keys = [
'cxx20',
'cxx23',
'cxx26',
'lwg',
'pr',
'bug',
'issue',
'avg_age',
'sum_age',
'merged',
] as const;
const daily_keys = ['cxx20', 'cxx23', 'cxx26', 'lwg', 'pr', 'bug', 'issue', 'sum_age', 'merged'] as const;
for (const field of daily_keys) {
const value = daily_table[daily_table.length - 1][field] ?? 0;
const span = getElementByIdAs(`currentValue-${field}`, HTMLSpanElement);
Expand Down
6 changes: 6 additions & 0 deletions src/weekly_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,10 @@ export const weekly_table: WeeklyRow[] = [
{ date: '2023-12-15', vso: 199, libcxx: 703 },
{ date: '2024-01-05', vso: 200, libcxx: 703 },
{ date: '2024-01-12', vso: 200, libcxx: 697 },
{ date: '2024-01-19', vso: 200, libcxx: 696 },
{ date: '2024-01-26', vso: 199, libcxx: 695 },
{ date: '2024-02-02', vso: 200, libcxx: 714 },
{ date: '2024-02-09', vso: 198, libcxx: 714 },
{ date: '2024-02-16', vso: 188, libcxx: 705 },
{ date: '2024-02-23', vso: 182, libcxx: 705 },
];
4 changes: 0 additions & 4 deletions src_gather/gather_stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ type Row = {
lwg: number;
issue: number;
bug: number;
avg_age: number;
sum_age: number;
};

Expand Down Expand Up @@ -505,7 +504,6 @@ function write_daily_table(script_start: DateTime, all_prs: CookedPRNode[], all_
lwg: num_lwg,
issue: num_issue,
bug: num_bug,
avg_age: num_pr === 0 ? 0 : combined_pr_age.as('days') / num_pr,
sum_age: combined_pr_age.as('months'),
});

Expand All @@ -526,7 +524,6 @@ export type DailyRow = {
lwg: number | null;
issue: number | null;
bug: number | null;
avg_age: number;
sum_age: number;
};
export const daily_table: DailyRow[] = [
Expand All @@ -547,7 +544,6 @@ export const daily_table: DailyRow[] = [
}
}

str += `avg_age: ${row.avg_age.toFixed(2)}, `;
str += `sum_age: ${row.sum_age.toFixed(2)}, `;
str += '} as DailyRow,\n';
}
Expand Down

0 comments on commit 576b598

Please sign in to comment.