mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 06:25:16 -07:00
feat: Add startup profiler to measure and record application initialization phases. (#13638)
This commit is contained in:
@@ -87,6 +87,7 @@ import { SubagentToolWrapper } from '../agents/subagent-tool-wrapper.js';
|
||||
import { getExperiments } from '../code_assist/experiments/experiments.js';
|
||||
import { ExperimentFlags } from '../code_assist/experiments/flagNames.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
import { startupProfiler } from '../telemetry/startupProfiler.js';
|
||||
|
||||
import { ApprovalMode } from '../policy/types.js';
|
||||
|
||||
@@ -620,6 +621,7 @@ export class Config {
|
||||
this.initialized = true;
|
||||
|
||||
// Initialize centralized FileDiscoveryService
|
||||
const discoverToolsHandle = startupProfiler.start('discover_tools');
|
||||
this.getFileService();
|
||||
if (this.getCheckpointingEnabled()) {
|
||||
await this.getGitService();
|
||||
@@ -630,15 +632,18 @@ export class Config {
|
||||
await this.agentRegistry.initialize();
|
||||
|
||||
this.toolRegistry = await this.createToolRegistry();
|
||||
discoverToolsHandle?.end();
|
||||
this.mcpClientManager = new McpClientManager(
|
||||
this.toolRegistry,
|
||||
this,
|
||||
this.eventEmitter,
|
||||
);
|
||||
const initMcpHandle = startupProfiler.start('initialize_mcp_clients');
|
||||
await Promise.all([
|
||||
await this.mcpClientManager.startConfiguredMcpServers(),
|
||||
await this.getExtensionLoader().start(this),
|
||||
]);
|
||||
initMcpHandle?.end();
|
||||
|
||||
// Initialize hook system if enabled
|
||||
if (this.enableHooks) {
|
||||
|
||||
Reference in New Issue
Block a user