mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Add telemetry for checkpoint save/restore/diff
This commit is contained in:
parent
85775ce0a5
commit
9c08d044b3
2 changed files with 21 additions and 0 deletions
|
|
@ -3798,6 +3798,8 @@ export class Cline {
|
|||
return
|
||||
}
|
||||
|
||||
telemetryService.captureCheckpointDiffed(this.taskId)
|
||||
|
||||
if (!previousCommitHash && mode === "checkpoint") {
|
||||
const previousCheckpoint = this.clineMessages
|
||||
.filter(({ say }) => say === "checkpoint_saved")
|
||||
|
|
@ -3849,6 +3851,8 @@ export class Cline {
|
|||
return
|
||||
}
|
||||
|
||||
telemetryService.captureCheckpointCreated(this.taskId)
|
||||
|
||||
// Start the checkpoint process in the background.
|
||||
service.saveCheckpoint(`Task: ${this.taskId}, Time: ${Date.now()}`).catch((err) => {
|
||||
console.error("[Cline#checkpointSave] caught unexpected error, disabling checkpoints", err)
|
||||
|
|
@ -3880,6 +3884,8 @@ export class Cline {
|
|||
try {
|
||||
await service.restoreCheckpoint(commitHash)
|
||||
|
||||
telemetryService.captureCheckpointRestored(this.taskId)
|
||||
|
||||
await this.providerRef.deref()?.postMessageToWebview({ type: "currentCheckpointUpdated", text: commitHash })
|
||||
|
||||
if (mode === "restore") {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ class PostHogClient {
|
|||
CONVERSATION_MESSAGE: "Conversation Message",
|
||||
MODE_SWITCH: "Mode Switched",
|
||||
TOOL_USED: "Tool Used",
|
||||
CHECKPOINT_CREATED: "Checkpoint Created",
|
||||
CHECKPOINT_RESTORED: "Checkpoint Restored",
|
||||
CHECKPOINT_DIFFED: "Checkpoint Diffed",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -246,6 +249,18 @@ class TelemetryService {
|
|||
})
|
||||
}
|
||||
|
||||
public captureCheckpointCreated(taskId: string): void {
|
||||
this.captureEvent(PostHogClient.EVENTS.TASK.CHECKPOINT_CREATED, { taskId })
|
||||
}
|
||||
|
||||
public captureCheckpointDiffed(taskId: string): void {
|
||||
this.captureEvent(PostHogClient.EVENTS.TASK.CHECKPOINT_DIFFED, { taskId })
|
||||
}
|
||||
|
||||
public captureCheckpointRestored(taskId: string): void {
|
||||
this.captureEvent(PostHogClient.EVENTS.TASK.CHECKPOINT_RESTORED, { taskId })
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if telemetry is currently enabled
|
||||
* @returns Whether telemetry is enabled
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue