Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
38b50912
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
38b50912
编写于
11月 29, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweak PS output
上级
307987fe
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
3 deletion
+24
-3
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+24
-3
未找到文件。
src/vs/code/electron-main/main.ts
浏览文件 @
38b50912
...
...
@@ -9,6 +9,7 @@ import { app, dialog } from 'electron';
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
product
from
'
vs/platform/node/product
'
;
import
pkg
from
'
vs/platform/node/package
'
;
import
{
parseMainProcessArgv
}
from
'
vs/platform/environment/node/argv
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
import
{
validatePaths
}
from
'
vs/code/node/paths
'
;
...
...
@@ -34,6 +35,8 @@ import { RequestService } from 'vs/platform/request/electron-main/requestService
import
{
IURLService
}
from
'
vs/platform/url/common/url
'
;
import
{
URLService
}
from
'
vs/platform/url/electron-main/urlService
'
;
import
*
as
fs
from
'
original-fs
'
;
import
*
as
os
from
'
os
'
;
import
{
virtualMachineHint
}
from
'
vs/base/node/id
'
;
import
{
CodeApplication
}
from
'
vs/code/electron-main/app
'
;
import
{
HistoryMainService
}
from
'
vs/platform/history/electron-main/historyMainService
'
;
import
{
IHistoryMainService
}
from
'
vs/platform/history/common/history
'
;
...
...
@@ -42,7 +45,7 @@ import { IWorkspacesMainService } from 'vs/platform/workspaces/common/workspaces
import
{
localize
}
from
'
vs/nls
'
;
import
{
mnemonicButtonLabel
}
from
'
vs/base/common/labels
'
;
import
{
listProcesses
,
ProcessItem
}
from
'
vs/base/node/ps
'
;
import
{
repeat
}
from
'
vs/base/common/strings
'
;
import
{
repeat
,
pad
}
from
'
vs/base/common/strings
'
;
function
createServices
(
args
:
ParsedArgs
):
IInstantiationService
{
const
services
=
new
ServiceCollection
();
...
...
@@ -207,15 +210,33 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> {
}
function
formatProcess
(
output
:
string
[],
item
:
ProcessItem
,
indent
:
number
):
void
{
const
isRoot
=
(
indent
===
0
);
const
MB
=
1024
*
1024
;
const
GB
=
1024
*
MB
;
if
(
isRoot
)
{
output
.
push
(
`Version:
${
pkg
.
name
}
${
pkg
.
version
}
(
${
product
.
commit
||
'
Commit unknown
'
}
,
${
product
.
date
||
'
Date unknown
'
}
)`
);
output
.
push
(
`OS Version:
${
os
.
type
()}
${
os
.
arch
()}
${
os
.
release
()}
`
);
const
cpus
=
os
.
cpus
();
if
(
cpus
&&
cpus
.
length
>
0
)
{
output
.
push
(
`CPUs:
${
cpus
[
0
].
model
}
(
${
cpus
.
length
}
x
${
cpus
[
0
].
speed
}
`
);
}
output
.
push
(
`Memory (System):
${(
os
.
totalmem
()
/
GB
).
toFixed
(
2
)}
GB (
${(
os
.
freemem
()
/
GB
).
toFixed
(
2
)}
GB free)`
);
output
.
push
(
`Load (avg):
${
os
.
loadavg
().
map
(
l
=>
Math
.
round
(
l
)).
join
(
'
,
'
)}
`
);
output
.
push
(
`VM:
${
Math
.
round
((
virtualMachineHint
.
value
()
*
100
))}
`
);
output
.
push
(
`Screen Reader:
${
app
.
isAccessibilitySupportEnabled
()
?
'
yes
'
:
'
no
'
}
`
);
output
.
push
(
''
);
output
.
push
(
'
CPU %
\t
Mem MB
\t
Process
'
);
}
// Format name with indent
let
name
:
string
;
if
(
i
ndent
===
0
)
{
if
(
i
sRoot
)
{
name
=
`
${
product
.
applicationName
}
main`
;
}
else
{
name
=
`
${
repeat
(
'
'
,
indent
)}
${
item
.
name
}
`
;
}
output
.
push
(
name
);
output
.
push
(
`
${
pad
(
Number
(
item
.
load
.
toFixed
(
0
)),
5
,
'
'
)}
\t
${
pad
(
Number
(((
os
.
totalmem
()
*
(
item
.
mem
/
100
))
/
MB
).
toFixed
(
0
)),
6
,
'
'
)}
\t
${
name
}
`
);
// Recurse into children if any
if
(
Array
.
isArray
(
item
.
children
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录