mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
rename(telemetry): Update ai_(added|removed)_lines to model_(added|removed)_lines (#7577)
Co-authored-by: Shnatu <snatu@google.com> Co-authored-by: Billy Biggs <bbiggs@google.com>
This commit is contained in:
+2
-2
@@ -275,8 +275,8 @@ Metrics are numerical measurements of behavior over time. The following metrics
|
|||||||
- `lines` (Int, if applicable): Number of lines in the file.
|
- `lines` (Int, if applicable): Number of lines in the file.
|
||||||
- `mimetype` (string, if applicable): Mimetype of the file.
|
- `mimetype` (string, if applicable): Mimetype of the file.
|
||||||
- `extension` (string, if applicable): File extension of the file.
|
- `extension` (string, if applicable): File extension of the file.
|
||||||
- `ai_added_lines` (Int, if applicable): Number of lines added/changed by AI.
|
- `model_added_lines` (Int, if applicable): Number of lines added/changed by the model.
|
||||||
- `ai_removed_lines` (Int, if applicable): Number of lines removed/changed by AI.
|
- `model_removed_lines` (Int, if applicable): Number of lines removed/changed by the model.
|
||||||
- `user_added_lines` (Int, if applicable): Number of lines added/changed by user in AI proposed changes.
|
- `user_added_lines` (Int, if applicable): Number of lines added/changed by user in AI proposed changes.
|
||||||
- `user_removed_lines` (Int, if applicable): Number of lines removed/changed by user in AI proposed changes.
|
- `user_removed_lines` (Int, if applicable): Number of lines removed/changed by user in AI proposed changes.
|
||||||
- `programming_language` (string, if applicable): The programming language of the file.
|
- `programming_language` (string, if applicable): The programming language of the file.
|
||||||
|
|||||||
@@ -465,8 +465,8 @@ export class ClearcutLogger {
|
|||||||
|
|
||||||
if (event.metadata) {
|
if (event.metadata) {
|
||||||
const metadataMapping: { [key: string]: EventMetadataKey } = {
|
const metadataMapping: { [key: string]: EventMetadataKey } = {
|
||||||
ai_added_lines: EventMetadataKey.GEMINI_CLI_AI_ADDED_LINES,
|
model_added_lines: EventMetadataKey.GEMINI_CLI_AI_ADDED_LINES,
|
||||||
ai_removed_lines: EventMetadataKey.GEMINI_CLI_AI_REMOVED_LINES,
|
model_removed_lines: EventMetadataKey.GEMINI_CLI_AI_REMOVED_LINES,
|
||||||
user_added_lines: EventMetadataKey.GEMINI_CLI_USER_ADDED_LINES,
|
user_added_lines: EventMetadataKey.GEMINI_CLI_USER_ADDED_LINES,
|
||||||
user_removed_lines: EventMetadataKey.GEMINI_CLI_USER_REMOVED_LINES,
|
user_removed_lines: EventMetadataKey.GEMINI_CLI_USER_REMOVED_LINES,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -163,8 +163,8 @@ export class ToolCallEvent implements BaseTelemetryEvent {
|
|||||||
const diffStat = (call.response.resultDisplay as FileDiff).diffStat;
|
const diffStat = (call.response.resultDisplay as FileDiff).diffStat;
|
||||||
if (diffStat) {
|
if (diffStat) {
|
||||||
this.metadata = {
|
this.metadata = {
|
||||||
ai_added_lines: diffStat.ai_added_lines,
|
model_added_lines: diffStat.model_added_lines,
|
||||||
ai_removed_lines: diffStat.ai_removed_lines,
|
model_removed_lines: diffStat.model_removed_lines,
|
||||||
user_added_lines: diffStat.user_added_lines,
|
user_added_lines: diffStat.user_added_lines,
|
||||||
user_removed_lines: diffStat.user_removed_lines,
|
user_removed_lines: diffStat.user_removed_lines,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -646,8 +646,8 @@ describe('UiTelemetryService', () => {
|
|||||||
...structuredClone(new ToolCallEvent(toolCall)),
|
...structuredClone(new ToolCallEvent(toolCall)),
|
||||||
'event.name': EVENT_TOOL_CALL,
|
'event.name': EVENT_TOOL_CALL,
|
||||||
metadata: {
|
metadata: {
|
||||||
ai_added_lines: 10,
|
model_added_lines: 10,
|
||||||
ai_removed_lines: 5,
|
model_removed_lines: 5,
|
||||||
},
|
},
|
||||||
} as ToolCallEvent & { 'event.name': typeof EVENT_TOOL_CALL };
|
} as ToolCallEvent & { 'event.name': typeof EVENT_TOOL_CALL };
|
||||||
|
|
||||||
@@ -664,8 +664,8 @@ describe('UiTelemetryService', () => {
|
|||||||
...structuredClone(new ToolCallEvent(toolCall)),
|
...structuredClone(new ToolCallEvent(toolCall)),
|
||||||
'event.name': EVENT_TOOL_CALL,
|
'event.name': EVENT_TOOL_CALL,
|
||||||
metadata: {
|
metadata: {
|
||||||
ai_added_lines: null,
|
model_added_lines: null,
|
||||||
ai_removed_lines: undefined,
|
model_removed_lines: undefined,
|
||||||
},
|
},
|
||||||
} as ToolCallEvent & { 'event.name': typeof EVENT_TOOL_CALL };
|
} as ToolCallEvent & { 'event.name': typeof EVENT_TOOL_CALL };
|
||||||
|
|
||||||
|
|||||||
@@ -224,11 +224,11 @@ export class UiTelemetryService extends EventEmitter {
|
|||||||
|
|
||||||
// Aggregate line count data from metadata
|
// Aggregate line count data from metadata
|
||||||
if (event.metadata) {
|
if (event.metadata) {
|
||||||
if (event.metadata['ai_added_lines'] !== undefined) {
|
if (event.metadata['model_added_lines'] !== undefined) {
|
||||||
files.totalLinesAdded += event.metadata['ai_added_lines'];
|
files.totalLinesAdded += event.metadata['model_added_lines'];
|
||||||
}
|
}
|
||||||
if (event.metadata['ai_removed_lines'] !== undefined) {
|
if (event.metadata['model_removed_lines'] !== undefined) {
|
||||||
files.totalLinesRemoved += event.metadata['ai_removed_lines'];
|
files.totalLinesRemoved += event.metadata['model_removed_lines'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'line1\nline2\n';
|
const userStr = 'line1\nline2\n';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 0,
|
model_added_lines: 0,
|
||||||
ai_removed_lines: 0,
|
model_removed_lines: 0,
|
||||||
model_added_chars: 0,
|
model_added_chars: 0,
|
||||||
model_removed_chars: 0,
|
model_removed_chars: 0,
|
||||||
user_added_lines: 0,
|
user_added_lines: 0,
|
||||||
@@ -33,8 +33,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'line1\nline2\nline3\n';
|
const userStr = 'line1\nline2\nline3\n';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 1,
|
model_added_lines: 1,
|
||||||
ai_removed_lines: 0,
|
model_removed_lines: 0,
|
||||||
model_added_chars: 5,
|
model_added_chars: 5,
|
||||||
model_removed_chars: 0,
|
model_removed_chars: 0,
|
||||||
user_added_lines: 0,
|
user_added_lines: 0,
|
||||||
@@ -50,8 +50,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'line1\nline3\n';
|
const userStr = 'line1\nline3\n';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 0,
|
model_added_lines: 0,
|
||||||
ai_removed_lines: 1,
|
model_removed_lines: 1,
|
||||||
model_added_chars: 0,
|
model_added_chars: 0,
|
||||||
model_removed_chars: 5,
|
model_removed_chars: 5,
|
||||||
user_added_lines: 0,
|
user_added_lines: 0,
|
||||||
@@ -67,8 +67,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'line1\nline_two\nline3\n';
|
const userStr = 'line1\nline_two\nline3\n';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 1,
|
model_added_lines: 1,
|
||||||
ai_removed_lines: 1,
|
model_removed_lines: 1,
|
||||||
model_added_chars: 8,
|
model_added_chars: 8,
|
||||||
model_removed_chars: 5,
|
model_removed_chars: 5,
|
||||||
user_added_lines: 0,
|
user_added_lines: 0,
|
||||||
@@ -84,8 +84,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'line1\nline2\nline3\nline4\n';
|
const userStr = 'line1\nline2\nline3\nline4\n';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 1,
|
model_added_lines: 1,
|
||||||
ai_removed_lines: 0,
|
model_removed_lines: 0,
|
||||||
model_added_chars: 5,
|
model_added_chars: 5,
|
||||||
model_removed_chars: 0,
|
model_removed_chars: 0,
|
||||||
user_added_lines: 1,
|
user_added_lines: 1,
|
||||||
@@ -101,8 +101,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'line1\nline2\n';
|
const userStr = 'line1\nline2\n';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 1,
|
model_added_lines: 1,
|
||||||
ai_removed_lines: 0,
|
model_removed_lines: 0,
|
||||||
model_added_chars: 5,
|
model_added_chars: 5,
|
||||||
model_removed_chars: 0,
|
model_removed_chars: 0,
|
||||||
user_added_lines: 0,
|
user_added_lines: 0,
|
||||||
@@ -118,8 +118,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'line1\nline2\nline_three\n';
|
const userStr = 'line1\nline2\nline_three\n';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 1,
|
model_added_lines: 1,
|
||||||
ai_removed_lines: 0,
|
model_removed_lines: 0,
|
||||||
model_added_chars: 5,
|
model_added_chars: 5,
|
||||||
model_removed_chars: 0,
|
model_removed_chars: 0,
|
||||||
user_added_lines: 1,
|
user_added_lines: 1,
|
||||||
@@ -135,8 +135,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'line_one\nline_two\nline_three\nline4\nline5\n';
|
const userStr = 'line_one\nline_two\nline_three\nline4\nline5\n';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 2,
|
model_added_lines: 2,
|
||||||
ai_removed_lines: 2,
|
model_removed_lines: 2,
|
||||||
model_added_chars: 18,
|
model_added_chars: 18,
|
||||||
model_removed_chars: 10,
|
model_removed_chars: 10,
|
||||||
user_added_lines: 2,
|
user_added_lines: 2,
|
||||||
@@ -152,8 +152,8 @@ describe('getDiffStat', () => {
|
|||||||
const userStr = 'hello universe';
|
const userStr = 'hello universe';
|
||||||
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
const diffStat = getDiffStat(fileName, oldStr, aiStr, userStr);
|
||||||
expect(diffStat).toEqual({
|
expect(diffStat).toEqual({
|
||||||
ai_added_lines: 1,
|
model_added_lines: 1,
|
||||||
ai_removed_lines: 1,
|
model_removed_lines: 1,
|
||||||
model_added_chars: 14,
|
model_added_chars: 14,
|
||||||
model_removed_chars: 11,
|
model_removed_chars: 11,
|
||||||
user_added_lines: 0,
|
user_added_lines: 0,
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ export function getDiffStat(
|
|||||||
const userStats = getStats(userPatch);
|
const userStats = getStats(userPatch);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ai_added_lines: modelStats.addedLines,
|
model_added_lines: modelStats.addedLines,
|
||||||
ai_removed_lines: modelStats.removedLines,
|
model_removed_lines: modelStats.removedLines,
|
||||||
model_added_chars: modelStats.addedChars,
|
model_added_chars: modelStats.addedChars,
|
||||||
model_removed_chars: modelStats.removedChars,
|
model_removed_chars: modelStats.removedChars,
|
||||||
user_added_lines: userStats.addedLines,
|
user_added_lines: userStats.addedLines,
|
||||||
|
|||||||
@@ -528,8 +528,8 @@ describe('EditTool', () => {
|
|||||||
expect(display.fileDiff).toMatch(/\+new text\n\+new text\n\+new text/);
|
expect(display.fileDiff).toMatch(/\+new text\n\+new text\n\+new text/);
|
||||||
expect(display.fileName).toBe(testFile);
|
expect(display.fileName).toBe(testFile);
|
||||||
expect((result.returnDisplay as FileDiff).diffStat).toStrictEqual({
|
expect((result.returnDisplay as FileDiff).diffStat).toStrictEqual({
|
||||||
ai_added_lines: 3,
|
model_added_lines: 3,
|
||||||
ai_removed_lines: 3,
|
model_removed_lines: 3,
|
||||||
model_added_chars: 24,
|
model_added_chars: 24,
|
||||||
model_removed_chars: 24,
|
model_removed_chars: 24,
|
||||||
user_added_lines: 0,
|
user_added_lines: 0,
|
||||||
@@ -593,8 +593,8 @@ describe('EditTool', () => {
|
|||||||
/User modified the `new_string` content/,
|
/User modified the `new_string` content/,
|
||||||
);
|
);
|
||||||
expect((result.returnDisplay as FileDiff).diffStat).toStrictEqual({
|
expect((result.returnDisplay as FileDiff).diffStat).toStrictEqual({
|
||||||
ai_added_lines: 1,
|
model_added_lines: 1,
|
||||||
ai_removed_lines: 1,
|
model_removed_lines: 1,
|
||||||
model_added_chars: 7,
|
model_added_chars: 7,
|
||||||
model_removed_chars: 8,
|
model_removed_chars: 8,
|
||||||
user_added_lines: 1,
|
user_added_lines: 1,
|
||||||
|
|||||||
@@ -443,8 +443,8 @@ export interface FileDiff {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DiffStat {
|
export interface DiffStat {
|
||||||
ai_added_lines: number;
|
model_added_lines: number;
|
||||||
ai_removed_lines: number;
|
model_removed_lines: number;
|
||||||
model_added_chars: number;
|
model_added_chars: number;
|
||||||
model_removed_chars: number;
|
model_removed_chars: number;
|
||||||
user_added_lines: number;
|
user_added_lines: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user