Fixes #112552: Set server marks to `ITimerService`

上级 9cb4f1e2
......@@ -5,6 +5,7 @@
import { URI } from 'vs/base/common/uri';
import { OperatingSystem } from 'vs/base/common/platform';
import * as performance from 'vs/base/common/performance';
export interface IRemoteAgentEnvironment {
pid: number;
......@@ -18,6 +19,7 @@ export interface IRemoteAgentEnvironment {
workspaceStorageHome: URI;
userHome: URI;
os: OperatingSystem;
marks: performance.PerformanceMark[];
}
export interface RemoteAgentConnectionContext {
......
......@@ -55,6 +55,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { RemoteStatusIndicator } from 'vs/workbench/contrib/remote/browser/remoteIndicator';
import * as icons from 'vs/workbench/contrib/remote/browser/remoteIcons';
import { ILogService } from 'vs/platform/log/common/log';
import { ITimerService } from 'vs/workbench/services/timer/browser/timerService';
export interface HelpInformation {
......@@ -596,6 +597,20 @@ Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions
CATEGORIES.View.value
);
class RemoteMarkers implements IWorkbenchContribution {
constructor(
@IRemoteAgentService remoteAgentService: IRemoteAgentService,
@ITimerService timerService: ITimerService,
) {
remoteAgentService.getEnvironment().then(remoteEnv => {
if (remoteEnv) {
timerService.setPerformanceMarks('server', remoteEnv.marks);
}
});
}
}
class VisibleProgress {
public readonly location: ProgressLocation;
......@@ -851,3 +866,4 @@ workbenchContributionsRegistry.registerWorkbenchContribution(RemoteStatusIndicat
workbenchContributionsRegistry.registerWorkbenchContribution(ForwardedPortsView, LifecyclePhase.Eventually);
workbenchContributionsRegistry.registerWorkbenchContribution(PortRestore, LifecyclePhase.Eventually);
workbenchContributionsRegistry.registerWorkbenchContribution(AutomaticPortForwarding, LifecyclePhase.Eventually);
workbenchContributionsRegistry.registerWorkbenchContribution(RemoteMarkers, LifecyclePhase.Eventually);
......@@ -65,7 +65,8 @@ export class RemoteExtensionEnvironmentChannelClient {
globalStorageHome: URI.revive(data.globalStorageHome),
workspaceStorageHome: URI.revive(data.workspaceStorageHome),
userHome: URI.revive(data.userHome),
os: data.os
os: data.os,
marks: data.marks
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册