Skip to content

Commit c6ba335

Browse files
committed
Update to 3.1.2
1 parent d376036 commit c6ba335

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

dist/modules/XProtoSSChe.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function getExtendedServerProtoSS(ProtoSSChe) {
6464
o.asyncId = null;
6565
o.collectionRR = [];
6666
o.collectionStats = [];
67-
o.collectionMax = 300;
67+
o.collectionMax = 0;
6868
o.initRoute();
6969
o.initAsyncGrid();
7070
}
@@ -99,16 +99,22 @@ function getExtendedServerProtoSS(ProtoSSChe) {
9999
avrgTime: 0,
100100
average: 0,
101101
units: 0,
102+
timestamp: new Date().getTime(),
103+
uptime: process.uptime(),
102104
cpus: 0,
103105
cpuTypes: [],
106+
resource: process.resourceUsage(),
104107
memory: os.totalmem(),
108+
freememory: os.freemem(),
109+
memoryUsage: process.memoryUsage(),
105110
};
106111
let firstin = o.collectionRR[0][0];
107112
let lastout = o.collectionRR[count - 1][1];
108113
o.collectionRR.forEach((e) => {
109114
stats.avrgTime += e[1].__timestamp - e[0].__timestamp;
110115
stats.units += e[0].__units || 0;
111116
stats.units += e[1].__units || 0;
117+
if (e[0].__timestamp < firstin.__timestamp) firstin = e[0];
112118
if (e[1].__timestamp > lastout.__timestamp) lastout = e[1];
113119
});
114120
stats.time = lastout.__timestamp - firstin.__timestamp;
@@ -120,7 +126,8 @@ function getExtendedServerProtoSS(ProtoSSChe) {
120126
var i, type, cpu, total;
121127
stats.cpus = cpus.length;
122128
for (i = 0; i < stats.cpus; i++) {
123-
(cpu = cpus[i]), (total = 0);
129+
cpu = cpus[i];
130+
total = 0;
124131
for (type in cpu.times) total += cpu.times[type];
125132
for (type in cpu.times) stats.cpuTypes.push([type, Math.round((100 * cpu.times[type]) / total)]);
126133
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "protoss-nodejs-basic",
3-
"version": "3.1.1",
3+
"version": "3.1.2",
44
"author": "Zeta Ret",
55
"license": "MIT",
66
"type": "commonjs",

protossdox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"relative": true,
1010
"markdown": true,
1111
"ext": ["js", "ts"],
12-
"version": "3.1.1",
12+
"version": "3.1.2",
1313
"license": "MIT"
1414
}

src/modules/XProtoSSChe.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function getExtendedServerProtoSS(ProtoSSChe: zetaret.node.ProtoSSCheCTOR): zeta
7777
o.asyncId = null;
7878
o.collectionRR = [];
7979
o.collectionStats = [];
80-
o.collectionMax = 300;
80+
o.collectionMax = 0;
8181
o.initRoute();
8282
o.initAsyncGrid();
8383
}
@@ -114,14 +114,17 @@ function getExtendedServerProtoSS(ProtoSSChe: zetaret.node.ProtoSSCheCTOR): zeta
114114
let count = o.collectionRR.length;
115115
let stats: any = {
116116
requests: count, time: 0, avrgTime: 0, average: 0, units: 0,
117-
cpus: 0, cpuTypes: [], memory: os.totalmem()
117+
timestamp: new Date().getTime(), uptime: process.uptime(),
118+
cpus: 0, cpuTypes: [], resource: process.resourceUsage(),
119+
memory: os.totalmem(), freememory: os.freemem(), memoryUsage: process.memoryUsage(),
118120
};
119121
let firstin = o.collectionRR[0][0];
120122
let lastout = o.collectionRR[count - 1][1];
121123
o.collectionRR.forEach((e: any) => {
122124
stats.avrgTime += e[1].__timestamp - e[0].__timestamp;
123125
stats.units += e[0].__units || 0;
124126
stats.units += e[1].__units || 0;
127+
if (e[0].__timestamp < firstin.__timestamp) firstin = e[0];
125128
if (e[1].__timestamp > lastout.__timestamp) lastout = e[1];
126129
});
127130
stats.time = lastout.__timestamp - firstin.__timestamp;
@@ -133,7 +136,8 @@ function getExtendedServerProtoSS(ProtoSSChe: zetaret.node.ProtoSSCheCTOR): zeta
133136
var i, type, cpu, total;
134137
stats.cpus = cpus.length;
135138
for (i = 0; i < stats.cpus; i++) {
136-
cpu = cpus[i], total = 0;
139+
cpu = cpus[i];
140+
total = 0;
137141
for (type in cpu.times) total += cpu.times[type];
138142
for (type in cpu.times) stats.cpuTypes.push([type, Math.round(100 * cpu.times[type] / total)]);
139143
}

0 commit comments

Comments
 (0)