Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ce8009cb
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ce8009cb
编写于
2月 03, 2020
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use Action2 for MeasureExtHostLatencyAction
上级
3d0dbfb8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
20 deletion
+19
-20
src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts
...services/extensions/common/extensionHostProcessManager.ts
+19
-20
未找到文件。
src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts
浏览文件 @
ce8009cb
...
...
@@ -9,7 +9,7 @@ import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
IMessagePassingProtocol
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ExtHostCustomersRegistry
}
from
'
vs/workbench/api/common/extHostCustomers
'
;
import
{
ExtHostContext
,
ExtHostExtensionServiceShape
,
IExtHostContext
,
MainContext
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
ProxyIdentifier
}
from
'
vs/workbench/services/extensions/common/proxyIdentifier
'
;
...
...
@@ -17,10 +17,7 @@ import { IRPCProtocolLogger, RPCProtocol, RequestInitiator, ResponsiveState } fr
import
{
RemoteAuthorityResolverError
,
ResolverResult
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
ExtensionIdentifier
,
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Extensions
as
ActionExtensions
,
IWorkbenchActionRegistry
}
from
'
vs/workbench/common/actions
'
;
import
{
registerAction2
,
Action2
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IUntitledTextResourceInput
}
from
'
vs/workbench/common/editor
'
;
import
{
StopWatch
}
from
'
vs/base/common/stopwatch
'
;
...
...
@@ -389,21 +386,26 @@ function getLatencyTestProviders(): ExtHostLatencyProvider[] {
return
providers
.
slice
(
0
);
}
export
class
MeasureExtHostLatencyAction
extends
Action
{
public
static
readonly
ID
=
'
editor.action.measureExtHostLatency
'
;
public
static
readonly
LABEL
=
nls
.
localize
(
'
measureExtHostLatency
'
,
"
Measure Extension Host Latency
"
);
registerAction2
(
class
MeasureExtHostLatencyAction
extends
Action2
{
constructor
(
id
:
string
,
label
:
string
,
@
IEditorService
private
readonly
_editorService
:
IEditorService
)
{
super
(
id
,
label
);
constructor
()
{
super
({
id
:
'
editor.action.measureExtHostLatency
'
,
title
:
{
value
:
nls
.
localize
(
'
measureExtHostLatency
'
,
"
Measure Extension Host Latency
"
),
original
:
'
Developer: Measure Extension Host Latency
'
},
category
:
nls
.
localize
(
'
developer
'
,
"
Developer
"
),
f1
:
true
});
}
public
async
run
():
Promise
<
any
>
{
async
run
(
accessor
:
ServicesAccessor
)
{
const
editorService
=
accessor
.
get
(
IEditorService
);
const
measurements
=
await
Promise
.
all
(
getLatencyTestProviders
().
map
(
provider
=>
provider
.
measure
()));
this
.
_
editorService
.
openEditor
({
contents
:
measurements
.
map
(
MeasureExtHostLatencyAction
.
_print
).
join
(
'
\n\n
'
),
options
:
{
pinned
:
true
}
}
as
IUntitledTextResourceInput
);
editorService
.
openEditor
({
contents
:
measurements
.
map
(
MeasureExtHostLatencyAction
.
_print
).
join
(
'
\n\n
'
),
options
:
{
pinned
:
true
}
}
as
IUntitledTextResourceInput
);
}
private
static
_print
(
m
:
ExtHostLatencyResult
|
null
):
string
{
...
...
@@ -422,7 +424,4 @@ export class MeasureExtHostLatencyAction extends Action {
}
return
`
${(
n
/
1024
/
1024
).
toFixed
(
1
)}
Mbps`
;
}
}
const
registry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
ActionExtensions
.
WorkbenchActions
);
registry
.
registerWorkbenchAction
(
SyncActionDescriptor
.
create
(
MeasureExtHostLatencyAction
,
MeasureExtHostLatencyAction
.
ID
,
MeasureExtHostLatencyAction
.
LABEL
),
'
Developer: Measure Extension Host Latency
'
,
nls
.
localize
(
'
developer
'
,
"
Developer
"
));
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录