mirror of https://gitee.com/bigwinds/arangodb
added missing figures
This commit is contained in:
parent
4acbffe372
commit
fc0ffd40b6
|
@ -167,13 +167,19 @@ function computeStatisticsRaw (start) {
|
|||
ioTime: null,
|
||||
bytesSent: null,
|
||||
bytesReceived: null,
|
||||
requestPerSecondOptions: null,
|
||||
requestPerSecondPut: null,
|
||||
requestPerSecondHead: null,
|
||||
requestPerSecondPost: null,
|
||||
requestPerSecondGet: null,
|
||||
optionsPerSecond: null,
|
||||
putsPerSecond: null,
|
||||
headsPerSecond: null,
|
||||
postsPerSecond: null,
|
||||
getsPerSecond: null,
|
||||
deletesPerSecond: null,
|
||||
othersPerSecond: null,
|
||||
asyncsPerSecond: null,
|
||||
virtualSize: null,
|
||||
majorPageFaults: null,
|
||||
residentSize: null,
|
||||
residentSizePercent: null,
|
||||
majorPageFaultsPerSecond: null,
|
||||
minorPageFaultsPerSecond: null,
|
||||
userTime: null,
|
||||
systemTime: null
|
||||
});
|
||||
|
@ -184,6 +190,7 @@ function computeStatisticsRaw (start) {
|
|||
lastRaw = raw;
|
||||
}
|
||||
else {
|
||||
var d = t - lastTime;
|
||||
|
||||
// x (aka time) axis
|
||||
times.push(t);
|
||||
|
@ -209,41 +216,56 @@ function computeStatisticsRaw (start) {
|
|||
|
||||
// data transfer figures
|
||||
data.bytesSent = avgPerTimeSlice(
|
||||
t - lastTime,
|
||||
d,
|
||||
raw.client.bytesSent,
|
||||
lastRaw.client.bytesSent);
|
||||
|
||||
data.bytesReceived = avgPerTimeSlice(
|
||||
t - lastTime,
|
||||
d,
|
||||
raw.client.bytesReceived,
|
||||
lastRaw.client.bytesReceived);
|
||||
|
||||
// requests
|
||||
data.optionsPerSecond = perTimeSlice(
|
||||
t - lastTime,
|
||||
d,
|
||||
raw.http.requestsOptions,
|
||||
lastRaw.http.requestsOptions);
|
||||
|
||||
data.putsPerSecond = perTimeSlice(
|
||||
t - lastTime,
|
||||
d,
|
||||
raw.http.requestsPut,
|
||||
lastRaw.http.requestsPut);
|
||||
|
||||
data.headsPerSecond = perTimeSlice(
|
||||
t - lastTime,
|
||||
d,
|
||||
raw.http.requestsHead,
|
||||
lastRaw.http.requestsHead);
|
||||
|
||||
data.postsPerSecond = perTimeSlice(
|
||||
t - lastTime,
|
||||
d,
|
||||
raw.http.requestsPost,
|
||||
lastRaw.http.requestsPost);
|
||||
|
||||
data.getsPerSecond = perTimeSlice(
|
||||
t - lastTime,
|
||||
d,
|
||||
raw.http.requestsGet,
|
||||
lastRaw.http.requestsGet);
|
||||
|
||||
data.deletesPerSecond = perTimeSlice(
|
||||
d,
|
||||
raw.http.requestsDelete,
|
||||
lastRaw.http.requestsDelete);
|
||||
|
||||
data.othersPerSecond = perTimeSlice(
|
||||
d,
|
||||
raw.http.requestsOther,
|
||||
lastRaw.http.requestsOther);
|
||||
|
||||
data.asyncsPerSecond = perTimeSlice(
|
||||
d,
|
||||
raw.http.requestsAsync,
|
||||
lastRaw.http.requestsAsync);
|
||||
|
||||
// memory size
|
||||
data.virtualSize = raw.system.virtualSize;
|
||||
data.residentSize = raw.system.residentSize;
|
||||
|
@ -251,10 +273,15 @@ function computeStatisticsRaw (start) {
|
|||
|
||||
// page faults
|
||||
data.majorPageFaultsPerSecond = perTimeSlice(
|
||||
t - lastTime,
|
||||
d,
|
||||
raw.system.majorPageFaults,
|
||||
lastRaw.system.majorPageFaults);
|
||||
|
||||
data.minorPageFaultsPerSecond = perTimeSlice(
|
||||
d,
|
||||
raw.system.minorPageFaults,
|
||||
lastRaw.system.minorPageFaults);
|
||||
|
||||
// cpu time
|
||||
data.userTime = raw.system.userTime;
|
||||
data.systemTime = raw.system.systemTime;
|
||||
|
@ -267,74 +294,260 @@ function computeStatisticsRaw (start) {
|
|||
}
|
||||
|
||||
var distribution;
|
||||
var server;
|
||||
var current;
|
||||
|
||||
if (lastRaw === null) {
|
||||
distribution = {
|
||||
bytesSent: null
|
||||
bytesSentPercent: null,
|
||||
bytesReceivedPercent: null,
|
||||
totalTimePercent: null,
|
||||
requestTimePercent: null,
|
||||
queueTimePercent: null
|
||||
};
|
||||
}
|
||||
else if (lastLastRaw === null) {
|
||||
distribution = {
|
||||
bytesSentPercent: avgPercentDistributon(
|
||||
lastRaw.client.bytesSent,
|
||||
null,
|
||||
internal.bytesSentDistribution),
|
||||
|
||||
bytesReceivedPercent: avgPercentDistributon(
|
||||
lastRaw.client.bytesReceived,
|
||||
null,
|
||||
internal.bytesReceivedDistribution),
|
||||
server = {
|
||||
physicalMemory: 0,
|
||||
uptime: 0
|
||||
};
|
||||
|
||||
totalTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.totalTime,
|
||||
null,
|
||||
internal.requestTimeDistribution),
|
||||
|
||||
requestTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.requestTime,
|
||||
null,
|
||||
internal.requestTimeDistribution),
|
||||
|
||||
queueTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.queueTime,
|
||||
null,
|
||||
internal.requestTimeDistribution)
|
||||
current = {
|
||||
asyncRequests: 0,
|
||||
asyncRequestsPercentChange: 0,
|
||||
clientConnections: 0,
|
||||
clientConnectionsPercentChange: 0,
|
||||
numberOfThreads: 0,
|
||||
numberOfThreadsPercentChange: 0
|
||||
};
|
||||
}
|
||||
else {
|
||||
distribution = {
|
||||
bytesSentPercent: avgPercentDistributon(
|
||||
lastRaw.client.bytesSent,
|
||||
lastLastRaw.client.bytesSent,
|
||||
internal.bytesSentDistribution),
|
||||
|
||||
bytesReceivedPercent: avgPercentDistributon(
|
||||
lastRaw.client.bytesReceived,
|
||||
lastLastRaw.client.bytesReceived,
|
||||
internal.bytesReceivedDistribution),
|
||||
|
||||
totalTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.totalTime,
|
||||
lastLastRaw.client.totalTime,
|
||||
internal.requestTimeDistribution),
|
||||
|
||||
requestTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.requestTime,
|
||||
lastLastRaw.client.requestTime,
|
||||
internal.requestTimeDistribution),
|
||||
|
||||
queueTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.queueTime,
|
||||
lastLastRaw.client.queueTime,
|
||||
internal.requestTimeDistribution)
|
||||
server = {
|
||||
physicalMemory: lastRaw.server.physicalMemory,
|
||||
uptime: lastRaw.server.uptime
|
||||
};
|
||||
|
||||
if (lastLastRaw === null) {
|
||||
current = {
|
||||
asyncRequests: lastRaw.http.requestsAsync,
|
||||
asyncRequestsPercentChange: 0,
|
||||
clientConnections: lastRaw.client.httpConnections,
|
||||
clientConnectionsPercentChange: 0,
|
||||
numberOfThreads: lastRaw.system.numberOfThreads,
|
||||
numberOfThreadsPercentChange: 0
|
||||
};
|
||||
|
||||
distribution = {
|
||||
bytesSentPercent: avgPercentDistributon(
|
||||
lastRaw.client.bytesSent,
|
||||
null,
|
||||
internal.bytesSentDistribution),
|
||||
|
||||
bytesReceivedPercent: avgPercentDistributon(
|
||||
lastRaw.client.bytesReceived,
|
||||
null,
|
||||
internal.bytesReceivedDistribution),
|
||||
|
||||
totalTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.totalTime,
|
||||
null,
|
||||
internal.requestTimeDistribution),
|
||||
|
||||
requestTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.requestTime,
|
||||
null,
|
||||
internal.requestTimeDistribution),
|
||||
|
||||
queueTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.queueTime,
|
||||
null,
|
||||
internal.requestTimeDistribution)
|
||||
};
|
||||
}
|
||||
else {
|
||||
var n1 = lastRaw.http.requestsAsync;
|
||||
var m1 = lastLastRaw.http.requestsAsync;
|
||||
var d1 = 0;
|
||||
|
||||
if (m1 !== 0) {
|
||||
d1 = (n1 - m1) / m1;
|
||||
}
|
||||
|
||||
var n2 = lastRaw.client.httpConnections;
|
||||
var m2 = lastLastRaw.client.httpConnections;
|
||||
var d2 = 0;
|
||||
|
||||
if (m2 !== 0) {
|
||||
d2 = (n2 - m2) / n2;
|
||||
}
|
||||
|
||||
var n3 = lastRaw.system.numberOfThreads;
|
||||
var m3 = lastLastRaw.system.numberOfThreads;
|
||||
var d3 = 0;
|
||||
|
||||
if (m3 !== 0) {
|
||||
d3 = (n3 - m3) / n3;
|
||||
}
|
||||
|
||||
current = {
|
||||
asyncRequests: n1,
|
||||
asyncRequestsPercentChange: d1,
|
||||
clientConnections: n2,
|
||||
clientConnectionsPercentChange: d2,
|
||||
numberOfThreads: n3,
|
||||
numberOfThreadsPercentChange: d3
|
||||
};
|
||||
|
||||
distribution = {
|
||||
bytesSentPercent: avgPercentDistributon(
|
||||
lastRaw.client.bytesSent,
|
||||
lastLastRaw.client.bytesSent,
|
||||
internal.bytesSentDistribution),
|
||||
|
||||
bytesReceivedPercent: avgPercentDistributon(
|
||||
lastRaw.client.bytesReceived,
|
||||
lastLastRaw.client.bytesReceived,
|
||||
internal.bytesReceivedDistribution),
|
||||
|
||||
totalTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.totalTime,
|
||||
lastLastRaw.client.totalTime,
|
||||
internal.requestTimeDistribution),
|
||||
|
||||
requestTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.requestTime,
|
||||
lastLastRaw.client.requestTime,
|
||||
internal.requestTimeDistribution),
|
||||
|
||||
queueTimePercent: avgPercentDistributon(
|
||||
lastRaw.client.queueTime,
|
||||
lastLastRaw.client.queueTime,
|
||||
internal.requestTimeDistribution)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
next: lastTime,
|
||||
times: times,
|
||||
series: series,
|
||||
distribution: distribution
|
||||
distribution: distribution,
|
||||
current: current,
|
||||
server: server
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief computeStatisticsRaw15M
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function computeStatisticsRaw15M (start) {
|
||||
var values = db._query(
|
||||
"FOR s IN _statistics "
|
||||
+ " FILTER s.time >= @m15 "
|
||||
+ " SORT s.time "
|
||||
+ " return { time: s.time, "
|
||||
+ " requestsAsync: s.http.requestsAsync, "
|
||||
+ " clientConnections: s.client.httpConnections, "
|
||||
+ " numberOfThreads: s.system.numberOfThreads, "
|
||||
+ " virtualSize: s.system.virtualSize }",
|
||||
{ m15: start - 15 * 60 });
|
||||
|
||||
var lastRaw = null;
|
||||
var count = 0;
|
||||
var sumAsyncs = 0;
|
||||
var sumConnections = 0;
|
||||
var sumThreads = 0;
|
||||
var sumVirtualSize = 0;
|
||||
|
||||
var firstAsyncs = null;
|
||||
var firstConnections = null;
|
||||
var firstThreads = null;
|
||||
var firstVirtualSize = null;
|
||||
|
||||
while (values.hasNext()) {
|
||||
var raw = values.next();
|
||||
|
||||
if (lastRaw === null) {
|
||||
lastRaw = raw;
|
||||
}
|
||||
else {
|
||||
var d = raw.time - lastRaw.time;
|
||||
|
||||
if (d !== 0) {
|
||||
var n1 = (raw.requestsAsync - lastRaw.requestsAsync) / d;
|
||||
var n2 = raw.clientConnections;
|
||||
var n3 = raw.numberOfThreads;
|
||||
var n4 = raw.virtualSize;
|
||||
|
||||
count++;
|
||||
sumAsyncs += n1;
|
||||
sumConnections += n2;
|
||||
sumThreads += n3;
|
||||
sumVirtualSize += n4;
|
||||
|
||||
if (firstAsyncs === null) {
|
||||
firstAsyncs = n1;
|
||||
}
|
||||
|
||||
if (firstConnections === null) {
|
||||
firstConnections = n2;
|
||||
}
|
||||
|
||||
if (firstThreads === null) {
|
||||
firstThreads = n3;
|
||||
}
|
||||
|
||||
if (firstVirtualSize === null) {
|
||||
firstVirtualSize = n4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count !== 0) {
|
||||
sumAsyncs /= count;
|
||||
sumConnections /= count;
|
||||
sumThreads /= count;
|
||||
sumVirtualSize /= count;
|
||||
}
|
||||
|
||||
if (firstAsyncs === null) {
|
||||
firstAsyncs = 0;
|
||||
}
|
||||
else if (firstAsyncs !== 0) {
|
||||
firstAsyncs = (sumAsyncs - firstAsyncs) / firstAsyncs;
|
||||
}
|
||||
|
||||
if (firstConnections === null) {
|
||||
firstConnections = 0;
|
||||
}
|
||||
else if (firstConnections !== 0) {
|
||||
firstConnections = (sumConnections - firstConnections) / firstConnections;
|
||||
}
|
||||
|
||||
if (firstThreads === null) {
|
||||
firstThreads = 0;
|
||||
}
|
||||
else if (firstThreads !== 0) {
|
||||
firstThreads = (sumThreads - firstThreads) / firstThreads;
|
||||
}
|
||||
|
||||
if (firstVirtualSize === null) {
|
||||
firstVirtualSize = 0;
|
||||
}
|
||||
else if (firstVirtualSize !== 0) {
|
||||
firstVirtualSize = (sumVirtualSize - firstVirtualSize) / firstVirtualSize;
|
||||
}
|
||||
|
||||
return {
|
||||
asyncsPerSecond: sumAsyncs,
|
||||
asyncsPerSecondPercentChange: firstAsyncs,
|
||||
clientConnections: sumConnections,
|
||||
clientConnectionsPercentChange: firstConnections,
|
||||
numberOfThreads: sumThreads,
|
||||
numberOfThreadsPercentChange: firstThreads,
|
||||
virtualSize: sumVirtualSize,
|
||||
virtualSizePercentChange: firstVirtualSize
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -357,7 +570,7 @@ function convertSeries (series, name) {
|
|||
/// @brief computeStatisticsSeries
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function computeStatisticsSeries (start) {
|
||||
function computeStatisticsSeries (start, attrs) {
|
||||
var result = {};
|
||||
var raw = computeStatisticsRaw(start);
|
||||
|
||||
|
@ -365,46 +578,173 @@ function computeStatisticsSeries (start) {
|
|||
result.waitFor = (raw.next + STATISTICS_INTERVALL) - internal.time();
|
||||
result.times = raw.times;
|
||||
|
||||
result.avgTotalTime = convertSeries(raw.series, "totalTime");
|
||||
result.totalTimeDistributionPercent = raw.distribution.totalTimePercent;
|
||||
if (result.waitFor < 1) {
|
||||
result.waitFor = 1;
|
||||
}
|
||||
|
||||
result.avgRequestTime = convertSeries(raw.series, "requestTime");
|
||||
result.requestTimeDistributionPercent = raw.distribution.requestTimePercent;
|
||||
if (attrs === null || attrs.avgTotalTime) {
|
||||
result.avgTotalTime = convertSeries(raw.series, "totalTime");
|
||||
}
|
||||
|
||||
result.avgQueueTime = convertSeries(raw.series, "queueTime");
|
||||
result.queueTimeDistributionPercent = raw.distribution.queueTimePercent;
|
||||
if (attrs === null || attrs.totalTimeDistributionPercent) {
|
||||
result.totalTimeDistributionPercent = raw.distribution.totalTimePercent;
|
||||
}
|
||||
|
||||
result.avgIoTime = convertSeries(raw.series, "ioTime");
|
||||
if (attrs === null || attrs.avgRequestTime) {
|
||||
result.avgRequestTime = convertSeries(raw.series, "requestTime");
|
||||
}
|
||||
|
||||
result.bytesSentPerSecond = convertSeries(raw.series, "bytesSent");
|
||||
result.bytesSentDistributionPercent = raw.distribution.bytesSentPercent;
|
||||
if (attrs === null || attrs.requestTimeDistribution) {
|
||||
result.requestTimeDistributionPercent = raw.distribution.requestTimePercent;
|
||||
}
|
||||
|
||||
result.bytesReceivedPerSecond = convertSeries(raw.series, "bytesReceived");
|
||||
result.bytesReceivedDistributionPercent = raw.distribution.bytesReceivedPercent;
|
||||
if (attrs === null || attrs.avgQueueTime) {
|
||||
result.avgQueueTime = convertSeries(raw.series, "queueTime");
|
||||
}
|
||||
|
||||
result.optionsPerSecond = convertSeries(raw.series, "optionsPerSecond");
|
||||
result.putsPerSecond = convertSeries(raw.series, "putsPerSecond");
|
||||
result.headsPerSecond = convertSeries(raw.series, "headsPerSecond");
|
||||
result.postsPerSecond = convertSeries(raw.series, "postsPerSecond");
|
||||
result.getsPerSecond = convertSeries(raw.series, "getsPerSecond");
|
||||
if (attrs === null || attrs.queueTimeDistributionPercent) {
|
||||
result.queueTimeDistributionPercent = raw.distribution.queueTimePercent;
|
||||
}
|
||||
|
||||
// result.asyncRequestsCurrent = computeAsyncRequestsCurrent(raw);
|
||||
// result.asyncRequests15M = computeAsyncRequests15M(raw);
|
||||
if (attrs === null || attrs.avgIoTime) {
|
||||
result.avgIoTime = convertSeries(raw.series, "ioTime");
|
||||
}
|
||||
|
||||
// result.clientConnectionsCurrent = computeClientConnectionsCurrent(raw);
|
||||
// result.clientConnections15M = computeClientConnections15M(raw);
|
||||
if (attrs === null || attrs.bytesSentPerSecond) {
|
||||
result.bytesSentPerSecond = convertSeries(raw.series, "bytesSent");
|
||||
}
|
||||
|
||||
// result.numberThreadsCurrent = computeNumberThreadsCurrent(raw);
|
||||
// result.numberThreads15M = computeNumberThreads15M(raw);
|
||||
if (attrs === null || attrs.bytesSentDistributionPercent) {
|
||||
result.bytesSentDistributionPercent = raw.distribution.bytesSentPercent;
|
||||
}
|
||||
|
||||
result.residentSize = convertSeries(raw.series, "residentSize");
|
||||
result.residentSizePercent = convertSeries(raw.series, "residentSizePercent");
|
||||
if (attrs === null || attrs.bytesReceivedPerSecond) {
|
||||
result.bytesReceivedPerSecond = convertSeries(raw.series, "bytesReceived");
|
||||
}
|
||||
|
||||
result.virtualSize = convertSeries(raw.series, "virtualSize");
|
||||
// result.virtualSize15M = computeVirtualSize15M(raw);
|
||||
if (attrs === null || attrs.bytesReceivedDistributionPercent) {
|
||||
result.bytesReceivedDistributionPercent = raw.distribution.bytesReceivedPercent;
|
||||
}
|
||||
|
||||
result.majorPageFaultsPerSecond = convertSeries(raw.series, "majorPageFaultsPerSecond");
|
||||
// result.cpuTime = computeCpuTime(raw);
|
||||
if (attrs === null || attrs.optionsPerSecond) {
|
||||
result.optionsPerSecond = convertSeries(raw.series, "optionsPerSecond");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.putsPerSecond) {
|
||||
result.putsPerSecond = convertSeries(raw.series, "putsPerSecond");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.headsPerSecond) {
|
||||
result.headsPerSecond = convertSeries(raw.series, "headsPerSecond");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.postsPerSecond) {
|
||||
result.postsPerSecond = convertSeries(raw.series, "postsPerSecond");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.getsPerSecond) {
|
||||
result.getsPerSecond = convertSeries(raw.series, "getsPerSecond");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.asyncsPerSecond) {
|
||||
result.asyncsPerSecond = convertSeries(raw.series, "asyncsPerSecond");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.asyncRequestsCurrent) {
|
||||
result.asyncRequestsCurrent = raw.current.asyncRequests;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.asyncRequestsCurrentPercentChange) {
|
||||
result.asyncRequestsCurrentPercentChange = raw.current.asyncRequestsPercentChange;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.clientConnectionsCurrent) {
|
||||
result.clientConnectionsCurrent = raw.current.clientConnections;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.clientConnectionsCurrentPercentChange) {
|
||||
result.clientConnectionsCurrentPercentChange = raw.current.clientConnectionsPercentChange;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.numberOfThreadsCurrent) {
|
||||
result.numberOfThreadsCurrent = raw.current.numberOfThreads;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.numberOfThreadsCurrentPercentChange) {
|
||||
result.numberOfThreadsCurrentPercentChange = raw.current.numberOfThreadsPercentChange;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.residentSize) {
|
||||
result.residentSize = convertSeries(raw.series, "residentSize");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.residentSizePercent) {
|
||||
result.residentSizePercent = convertSeries(raw.series, "residentSizePercent");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.virtualSize) {
|
||||
result.virtualSize = convertSeries(raw.series, "virtualSize");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.majorPageFaultsPerSecond) {
|
||||
result.majorPageFaultsPerSecond = convertSeries(raw.series, "majorPageFaultsPerSecond");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.minorPageFaultsPerSecond) {
|
||||
result.minorPageFaultsPerSecond = convertSeries(raw.series, "minorPageFaultsPerSecond");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.cpuUserTime) {
|
||||
result.cpuUserTime = convertSeries(raw.series, "userTime");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.cpuSystemTime) {
|
||||
result.cpuSystemTime = convertSeries(raw.series, "systemTime");
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.uptime) {
|
||||
result.uptime = raw.server.uptime;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.physicalMemory) {
|
||||
result.physicalMemory = raw.server.physicalMemory;
|
||||
}
|
||||
|
||||
if (result.next !== null) {
|
||||
var raw15 = computeStatisticsRaw15M(raw.next);
|
||||
|
||||
if (attrs === null || attrs.asyncsPerSecond15M) {
|
||||
result.asyncsPerSecond15M = raw15.asyncsPerSecond;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.asyncsPerSecondPercentChange15M) {
|
||||
result.asyncsPerSecondPercentChange15M = raw15.asyncsPerSecondPercentChange;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.clientConnections15M) {
|
||||
result.clientConnections15M = raw15.clientConnections;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.clientConnectionsPercentChange15M) {
|
||||
result.clientConnectionsPercentChange15M = raw15.clientConnectionsPercentChange;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.numberOfThreads15M) {
|
||||
result.numberOfThreads15M = raw15.numberOfThreads;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.numberOfThreadsPercentChange15M) {
|
||||
result.numberOfThreadsPercentChange15M = raw15.numberOfThreadsPercentChange;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.virtualSize15M) {
|
||||
result.virtualSize15M = raw15.virtualSize;
|
||||
}
|
||||
|
||||
if (attrs === null || attrs.virtualSizePercentChange15M) {
|
||||
result.virtualSizePercentChange15M = raw15.virtualSizePercentChange;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -419,12 +759,25 @@ function computeStatisticsSeries (start) {
|
|||
|
||||
controller.get("full", function (req, res) {
|
||||
var start = req.params("start");
|
||||
var filter = req.params("filter");
|
||||
var attrs = null;
|
||||
|
||||
if (start !== null && start !== undefined) {
|
||||
start = parseInt(start, 10);
|
||||
}
|
||||
|
||||
var series = computeStatisticsSeries(start);
|
||||
if (filter !== null && filter !== undefined && filter !== "") {
|
||||
var s = filter.split(",");
|
||||
var i;
|
||||
|
||||
attrs = {};
|
||||
|
||||
for (i = 0; i < s.length; ++i) {
|
||||
attrs[s[i]] = true;
|
||||
}
|
||||
}
|
||||
|
||||
var series = computeStatisticsSeries(start, attrs);
|
||||
|
||||
res.json(series);
|
||||
}).summary("Returns the complete or partial history")
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
#define TRI_HAVE_GETPWNAM 1
|
||||
#define TRI_HAVE_GETPWUID 1
|
||||
#define TRI_HAVE_GETRUSAGE 1
|
||||
#define TRI_GETRUSAGE_MAXRSS_UNIT 1
|
||||
#define TRI_HAVE_GETTIMEOFDAY 1
|
||||
#define TRI_HAVE_GMTIME_R 1
|
||||
#define TRI_HAVE_SETGID 1
|
||||
|
@ -250,6 +251,7 @@
|
|||
#define TRI_HAVE_GETPWNAM 1
|
||||
#define TRI_HAVE_GETPWUID 1
|
||||
#define TRI_HAVE_GETRUSAGE 1
|
||||
#define TRI_GETRUSAGE_MAXRSS_UNIT 1024
|
||||
#define TRI_HAVE_GETTIMEOFDAY 1
|
||||
#define TRI_HAVE_GMTIME_R 1
|
||||
#define TRI_HAVE_SETGID 1
|
||||
|
@ -402,6 +404,7 @@
|
|||
#define TRI_HAVE_GETPWNAM 1
|
||||
#define TRI_HAVE_GETPWUID 1
|
||||
#define TRI_HAVE_GETRUSAGE 1
|
||||
#define TRI_GETRUSAGE_MAXRSS_UNIT 1024
|
||||
#define TRI_HAVE_GETTIMEOFDAY 1
|
||||
#define TRI_HAVE_GMTIME_R 1
|
||||
#define TRI_HAVE_PRCTL 1
|
||||
|
|
|
@ -567,7 +567,7 @@ TRI_process_info_t TRI_ProcessInfoSelf () {
|
|||
result._userTime = TRI_MicrosecondsTv(&used.ru_utime);
|
||||
|
||||
// ru_maxrss is the resident set size in kilobytes. need to multiply with 1024 to get the number of bytes
|
||||
result._residentSize = used.ru_maxrss * 1024;
|
||||
result._residentSize = used.ru_maxrss * TRI_GETRUSAGE_MAXRSS_UNIT;
|
||||
}
|
||||
|
||||
#ifdef TRI_HAVE_MACH
|
||||
|
|
|
@ -1743,7 +1743,7 @@ static v8::Handle<v8::Value> JS_ProcessStatistics (v8::Arguments const& argv) {
|
|||
double rssp = 0;
|
||||
|
||||
if (TRI_PhysicalMemory != 0) {
|
||||
rssp = 100.0 * rss / TRI_PhysicalMemory;
|
||||
rssp = rss / TRI_PhysicalMemory;
|
||||
}
|
||||
|
||||
result->Set(v8::String::New("minorPageFaults"), v8::Number::New((double) info._minorPageFaults));
|
||||
|
|
Loading…
Reference in New Issue