Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
motorCity
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
motorCity
Commits
688e8a5b
Commit
688e8a5b
authored
Aug 24, 2022
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
f757148c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
20 deletions
+5
-20
data.ts
src/biz/jgfwnl/data.ts
+3
-4
wsData.ts
src/data/interface/wsData.ts
+1
-1
main.ts
src/main.ts
+1
-15
No files found.
src/biz/jgfwnl/data.ts
View file @
688e8a5b
...
...
@@ -14,12 +14,11 @@ export async function getYZY(req, res) {
let
{
计算云资源
,
使用率
,
物理资源
}
=
await
getHardware
();
// let 计算云资源 = {"cpu":"3568核", "内存":"4000G", "本地磁盘":"1999G", "云磁盘总量":"848484G"};
ret
[
"api1"
]
=
getKeyValueNumberOutData
(
"计算云资源"
,
计算云资源
);
// let 使用率 = {"CPU":"63.9%", "内存":"30.4%", "本地磁盘":"29.6%", "云磁盘cds ssd池":"23%", "云磁盘cds sata池":"73%", "对象存储":"73.83%"};
ret
[
"api2"
]
=
getKeyValueNumberOutData
(
"计算云资源使用率"
,
使用率
);
// let 物理资源 = {"物理机":"100台", "网络设备":"34台", "安全设备":"4台", "机柜":"16台"};
ret
[
"api1"
]
=
getKeyValueNumberOutData
(
"计算云资源"
,
计算云资源
);
ret
[
"api2"
]
=
getKeyValueNumberOutData
(
"计算云资源使用率"
,
使用率
);
ret
[
"api3"
]
=
getKeyValueNumberOutData
(
"物理资源"
,
物理资源
);
res
.
send
(
ret
);
...
...
src/data/interface/wsData.ts
View file @
688e8a5b
...
...
@@ -100,7 +100,7 @@ export async function initWSData() {
//在线车辆
let
distinctMap
=
{};
//{id:1}
let
carData
=
{};
//
let
dp
=
{};
//数据池 {"id":{lastMs:最新的时间, list:[] } }
export
function
stats
(
data
)
{
let
dataType
=
typeof
data
;
...
...
src/main.ts
View file @
688e8a5b
...
...
@@ -6,26 +6,13 @@ import { initWSData } from "./data/interface/wsData";
import
{
httpServer
}
from
"./net/http_server"
;
async
function
lanuch
()
{
console
.
log
(
"测试服务启动成功 9797"
);
await
initConfig
();
//初始化配置解析
await
initWSData
();
httpServer
.
createServer
(
port
);
await
initSocketServer
(
socketPort
);
await
initData
();
await
initWSData
();
console
.
log
(
'This indicates that the server is started successfully.'
);
}
//test 模拟数据
async
function
test
()
{
let
i
=
1
;
setInterval
(
function
()
{
callTestServer
(
i
);
i
++
;
if
(
i
==
30
)
i
=
1
;
},
200
)
}
lanuch
();
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment