* Stops tracking CLI activity
(operationId: string)
| 104 | * Stops tracking CLI activity |
| 105 | */ |
| 106 | endCLIActivity(operationId: string): void { |
| 107 | this.activeOperations.delete(operationId) |
| 108 | |
| 109 | if (this.activeOperations.size === 0) { |
| 110 | // Last operation ended - CLI becoming inactive |
| 111 | // Record the CLI time before switching to inactive |
| 112 | const now = this.getNow() |
| 113 | const timeSinceLastRecord = (now - this.lastCLIRecordedTime) / 1000 |
| 114 | |
| 115 | if (timeSinceLastRecord > 0) { |
| 116 | const activeTimeCounter = this.getActiveTimeCounter() |
| 117 | if (activeTimeCounter) { |
| 118 | activeTimeCounter.add(timeSinceLastRecord, { type: 'cli' }) |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | this.lastCLIRecordedTime = now |
| 123 | this.isCLIActive = false |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Convenience method to track an async operation automatically (mainly for testing/debugging) |
no test coverage detected