Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d94ce50f
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,发现更多精彩内容 >>
提交
d94ce50f
编写于
2月 15, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null checks for perfviewEditor
上级
d7b9db88
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
13 deletion
+25
-13
src/vs/workbench/common/editor/resourceEditorInput.ts
src/vs/workbench/common/editor/resourceEditorInput.ts
+4
-4
src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts
...ch/contrib/performance/electron-browser/perfviewEditor.ts
+21
-9
未找到文件。
src/vs/workbench/common/editor/resourceEditorInput.ts
浏览文件 @
d94ce50f
...
...
@@ -19,14 +19,14 @@ export class ResourceEditorInput extends EditorInput {
static
readonly
ID
:
string
=
'
workbench.editors.resourceEditorInput
'
;
private
modelReference
:
Promise
<
IReference
<
ITextEditorModel
>>
;
private
modelReference
:
Promise
<
IReference
<
ITextEditorModel
>>
|
null
;
private
resource
:
URI
;
private
name
:
string
;
private
description
:
string
;
private
description
:
string
|
null
;
constructor
(
name
:
string
,
description
:
string
,
description
:
string
|
null
,
resource
:
URI
,
@
ITextModelService
private
readonly
textModelResolverService
:
ITextModelService
,
@
IHashService
private
readonly
hashService
:
IHashService
...
...
@@ -57,7 +57,7 @@ export class ResourceEditorInput extends EditorInput {
}
}
getDescription
():
string
{
getDescription
():
string
|
null
{
return
this
.
description
;
}
...
...
src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts
浏览文件 @
d94ce50f
...
...
@@ -52,7 +52,7 @@ export class PerfviewInput extends ResourceEditorInput {
)
{
super
(
localize
(
'
name
'
,
"
Startup Performance
"
),
undefined
,
null
,
PerfviewInput
.
Uri
,
textModelResolverService
,
hashService
);
...
...
@@ -85,7 +85,11 @@ class PerfModelContentProvider implements ITextModelContentProvider {
const
langId
=
this
.
_modeService
.
create
(
'
markdown
'
);
this
.
_model
=
this
.
_modelService
.
getModel
(
resource
)
||
this
.
_modelService
.
createModel
(
'
Loading...
'
,
langId
,
resource
);
this
.
_modelDisposables
.
push
(
langId
.
onDidChange
(
e
=>
this
.
_model
.
setMode
(
e
)));
this
.
_modelDisposables
.
push
(
langId
.
onDidChange
(
e
=>
{
if
(
this
.
_model
)
{
this
.
_model
.
setMode
(
e
);
}
}));
this
.
_modelDisposables
.
push
(
langId
);
this
.
_modelDisposables
.
push
(
this
.
_extensionService
.
onDidChangeExtensionsStatus
(
this
.
_updateModel
,
this
));
...
...
@@ -102,7 +106,7 @@ class PerfModelContentProvider implements ITextModelContentProvider {
this
.
_lifecycleService
.
when
(
LifecyclePhase
.
Eventually
),
this
.
_extensionService
.
whenInstalledExtensionsRegistered
()
]).
then
(([
metrics
])
=>
{
if
(
!
this
.
_model
.
isDisposed
())
{
if
(
this
.
_model
&&
!
this
.
_model
.
isDisposed
())
{
let
stats
=
this
.
_envService
.
args
[
'
prof-modules
'
]
?
LoaderStats
.
get
()
:
undefined
;
let
md
=
new
MarkdownBuilder
();
...
...
@@ -126,9 +130,15 @@ class PerfModelContentProvider implements ITextModelContentProvider {
md
.
heading
(
2
,
'
System Info
'
);
md
.
li
(
`
${
product
.
nameShort
}
:
${
pkg
.
version
}
(
${
product
.
commit
||
'
0000000
'
}
)`
);
md
.
li
(
`OS:
${
metrics
.
platform
}
(
${
metrics
.
release
}
)`
);
md
.
li
(
`CPUs:
${
metrics
.
cpus
.
model
}
(
${
metrics
.
cpus
.
count
}
x
${
metrics
.
cpus
.
speed
}
)`
);
md
.
li
(
`Memory(System):
${(
metrics
.
totalmem
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)}
GB(
${(
metrics
.
freemem
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)}
GB free)`
);
md
.
li
(
`Memory(Process):
${(
metrics
.
meminfo
.
workingSetSize
/
1024
).
toFixed
(
2
)}
MB working set(
${(
metrics
.
meminfo
.
peakWorkingSetSize
/
1024
).
toFixed
(
2
)}
MB peak,
${(
metrics
.
meminfo
.
privateBytes
/
1024
).
toFixed
(
2
)}
MB private,
${(
metrics
.
meminfo
.
sharedBytes
/
1024
).
toFixed
(
2
)}
MB shared)`
);
if
(
metrics
.
cpus
)
{
md
.
li
(
`CPUs:
${
metrics
.
cpus
.
model
}
(
${
metrics
.
cpus
.
count
}
x
${
metrics
.
cpus
.
speed
}
)`
);
}
if
(
typeof
metrics
.
totalmem
===
'
number
'
&&
typeof
metrics
.
freemem
===
'
number
'
)
{
md
.
li
(
`Memory(System):
${(
metrics
.
totalmem
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)}
GB(
${(
metrics
.
freemem
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)}
GB free)`
);
}
if
(
metrics
.
meminfo
)
{
md
.
li
(
`Memory(Process):
${(
metrics
.
meminfo
.
workingSetSize
/
1024
).
toFixed
(
2
)}
MB working set(
${(
metrics
.
meminfo
.
peakWorkingSetSize
/
1024
).
toFixed
(
2
)}
MB peak,
${(
metrics
.
meminfo
.
privateBytes
/
1024
).
toFixed
(
2
)}
MB private,
${(
metrics
.
meminfo
.
sharedBytes
/
1024
).
toFixed
(
2
)}
MB shared)`
);
}
md
.
li
(
`VM(likelyhood):
${
metrics
.
isVMLikelyhood
}
%`
);
md
.
li
(
`Initial Startup:
${
metrics
.
initialStartup
}
`
);
md
.
li
(
`Has
${
metrics
.
windowCount
-
1
}
other windows`
);
...
...
@@ -138,7 +148,7 @@ class PerfModelContentProvider implements ITextModelContentProvider {
private
_addSummaryTable
(
md
:
MarkdownBuilder
,
metrics
:
IStartupMetrics
,
stats
?:
LoaderStats
):
void
{
const
table
:
(
string
|
number
)[][]
=
[];
const
table
:
Array
<
Array
<
string
|
number
|
undefined
>>
=
[];
table
.
push
([
'
start => app.isReady
'
,
metrics
.
timers
.
ellapsedAppReady
,
'
[main]
'
,
`initial startup:
${
metrics
.
initialStartup
}
`
]);
table
.
push
([
'
nls:start => nls:end
'
,
metrics
.
timers
.
ellapsedNlsGeneration
,
'
[main]
'
,
`initial startup:
${
metrics
.
initialStartup
}
`
]);
table
.
push
([
'
require(main.bundle.js)
'
,
metrics
.
initialStartup
?
perf
.
getDuration
(
'
willLoadMainBundle
'
,
'
didLoadMainBundle
'
)
:
undefined
,
'
[main]
'
,
`initial startup:
${
metrics
.
initialStartup
}
`
]);
...
...
@@ -333,7 +343,7 @@ class MarkdownBuilder {
return
this
;
}
table
(
header
:
string
[],
rows
:
{
toString
()
}[][]
)
{
table
(
header
:
string
[],
rows
:
Array
<
Array
<
{
toString
():
string
}
|
undefined
>>
)
{
let
lengths
:
number
[]
=
[];
header
.
forEach
((
cell
,
ci
)
=>
{
lengths
[
ci
]
=
cell
.
length
;
...
...
@@ -357,7 +367,9 @@ class MarkdownBuilder {
// cells
rows
.
forEach
(
row
=>
{
row
.
forEach
((
cell
,
ci
)
=>
{
this
.
value
+=
`|
${
cell
+
repeat
(
'
'
,
lengths
[
ci
]
-
cell
.
toString
().
length
)}
`
;
if
(
typeof
cell
!==
'
undefined
'
)
{
this
.
value
+=
`|
${
cell
+
repeat
(
'
'
,
lengths
[
ci
]
-
cell
.
toString
().
length
)}
`
;
}
});
this
.
value
+=
'
|
\n
'
;
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录