mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 23:40:44 +00:00
feat: emit diagnostics timeline
This commit is contained in:
@@ -12,6 +12,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import type { PluginInstallRecord } from "../config/types.plugins.js";
|
||||
import type { GatewayRequestHandler } from "../gateway/server-methods/types.js";
|
||||
import { openBoundaryFileSync } from "../infra/boundary-file-read.js";
|
||||
import { measureDiagnosticsTimelineSpanSync } from "../infra/diagnostics-timeline.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
import {
|
||||
DEFAULT_MEMORY_DREAMING_PLUGIN_ID,
|
||||
@@ -2136,7 +2137,18 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
|
||||
env,
|
||||
warn: (message) => logger.warn(`[plugins] ${record.id}: ${message}`),
|
||||
}));
|
||||
installer(installParams);
|
||||
measureDiagnosticsTimelineSpanSync(
|
||||
"runtimeDeps.stage",
|
||||
() => installer(installParams),
|
||||
{
|
||||
phase: "startup",
|
||||
env,
|
||||
attributes: {
|
||||
pluginId: record.id,
|
||||
dependencyCount: installSpecs.length,
|
||||
},
|
||||
},
|
||||
);
|
||||
},
|
||||
logInstalled: (installedSpecs) => {
|
||||
if (shouldActivate) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { measureDiagnosticsTimelineSpanSync } from "../infra/diagnostics-timeline.js";
|
||||
import { resolveInstalledPluginIndexPolicyHash } from "./installed-plugin-index-policy.js";
|
||||
import type { InstalledPluginIndex } from "./installed-plugin-index.js";
|
||||
import {
|
||||
@@ -123,6 +124,23 @@ export function buildPluginMetadataOwnerMaps(
|
||||
|
||||
export function loadPluginMetadataSnapshot(
|
||||
params: LoadPluginMetadataSnapshotParams,
|
||||
): PluginMetadataSnapshot {
|
||||
return measureDiagnosticsTimelineSpanSync(
|
||||
"plugins.metadata.scan",
|
||||
() => loadPluginMetadataSnapshotImpl(params),
|
||||
{
|
||||
phase: "startup",
|
||||
env: params.env,
|
||||
attributes: {
|
||||
hasWorkspaceDir: params.workspaceDir !== undefined,
|
||||
hasInstalledIndex: params.index !== undefined,
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function loadPluginMetadataSnapshotImpl(
|
||||
params: LoadPluginMetadataSnapshotParams,
|
||||
): PluginMetadataSnapshot {
|
||||
const totalStartedAt = performance.now();
|
||||
const registryStartedAt = performance.now();
|
||||
|
||||
Reference in New Issue
Block a user