mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-03 08:24:10 -07:00
# Metrics Integrity & Standardized Reporting (BT-01) (#26240)
Co-authored-by: gemini-cli[bot] <gemini-cli[bot]@users.noreply.github.com> Co-authored-by: Christian Gunderman <gundermanc@google.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* @license
|
||||
*/
|
||||
|
||||
import { GITHUB_OWNER, GITHUB_REPO, type MetricOutput } from '../types.js';
|
||||
import { GITHUB_OWNER, GITHUB_REPO } from '../types.js';
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
try {
|
||||
@@ -87,61 +87,33 @@ try {
|
||||
),
|
||||
);
|
||||
|
||||
const timestamp = new Date().toISOString();
|
||||
|
||||
const metrics: MetricOutput[] = [
|
||||
{
|
||||
metric: 'throughput_pr_overall_per_day',
|
||||
value: Math.round(prOverall * 100) / 100,
|
||||
timestamp,
|
||||
},
|
||||
{
|
||||
metric: 'throughput_pr_maintainers_per_day',
|
||||
value: Math.round(prMaintainers * 100) / 100,
|
||||
timestamp,
|
||||
},
|
||||
{
|
||||
metric: 'throughput_pr_community_per_day',
|
||||
value: Math.round(prCommunity * 100) / 100,
|
||||
timestamp,
|
||||
},
|
||||
{
|
||||
metric: 'throughput_issue_overall_per_day',
|
||||
value: Math.round(issueOverall * 100) / 100,
|
||||
timestamp,
|
||||
},
|
||||
{
|
||||
metric: 'throughput_issue_maintainers_per_day',
|
||||
value: Math.round(issueMaintainers * 100) / 100,
|
||||
timestamp,
|
||||
},
|
||||
{
|
||||
metric: 'throughput_issue_community_per_day',
|
||||
value: Math.round(issueCommunity * 100) / 100,
|
||||
timestamp,
|
||||
},
|
||||
{
|
||||
metric: 'throughput_issue_overall_days_per_issue',
|
||||
value: issueOverall > 0 ? Math.round((1 / issueOverall) * 100) / 100 : 0,
|
||||
timestamp,
|
||||
},
|
||||
{
|
||||
metric: 'throughput_issue_maintainers_days_per_issue',
|
||||
value:
|
||||
issueMaintainers > 0
|
||||
? Math.round((1 / issueMaintainers) * 100) / 100
|
||||
: 0,
|
||||
timestamp,
|
||||
},
|
||||
{
|
||||
metric: 'throughput_issue_community_days_per_issue',
|
||||
value:
|
||||
issueCommunity > 0 ? Math.round((1 / issueCommunity) * 100) / 100 : 0,
|
||||
timestamp,
|
||||
},
|
||||
];
|
||||
|
||||
metrics.forEach((m) => process.stdout.write(JSON.stringify(m) + '\n'));
|
||||
process.stdout.write(
|
||||
`throughput_pr_overall_per_day,${Math.round(prOverall * 100) / 100}\n`,
|
||||
);
|
||||
process.stdout.write(
|
||||
`throughput_pr_maintainers_per_day,${Math.round(prMaintainers * 100) / 100}\n`,
|
||||
);
|
||||
process.stdout.write(
|
||||
`throughput_pr_community_per_day,${Math.round(prCommunity * 100) / 100}\n`,
|
||||
);
|
||||
process.stdout.write(
|
||||
`throughput_issue_overall_per_day,${Math.round(issueOverall * 100) / 100}\n`,
|
||||
);
|
||||
process.stdout.write(
|
||||
`throughput_issue_maintainers_per_day,${Math.round(issueMaintainers * 100) / 100}\n`,
|
||||
);
|
||||
process.stdout.write(
|
||||
`throughput_issue_community_per_day,${Math.round(issueCommunity * 100) / 100}\n`,
|
||||
);
|
||||
process.stdout.write(
|
||||
`throughput_issue_overall_days_per_issue,${issueOverall > 0 ? Math.round((1 / issueOverall) * 100) / 100 : 0}\n`,
|
||||
);
|
||||
process.stdout.write(
|
||||
`throughput_issue_maintainers_days_per_issue,${issueMaintainers > 0 ? Math.round((1 / issueMaintainers) * 100) / 100 : 0}\n`,
|
||||
);
|
||||
process.stdout.write(
|
||||
`throughput_issue_community_days_per_issue,${issueCommunity > 0 ? Math.round((1 / issueCommunity) * 100) / 100 : 0}\n`,
|
||||
);
|
||||
} catch (err) {
|
||||
process.stderr.write(err instanceof Error ? err.message : String(err));
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user