mirror of https://gitee.com/bigwinds/arangodb
try to fix "caught exception during statistics processing: Expecting Object" errors that may happen right after upgrading from 3.3
This commit is contained in:
parent
435c014a15
commit
f0cc698872
|
@ -363,55 +363,81 @@ void StatisticsWorker::compute15Minute(VPackBuilder& builder, double start) {
|
||||||
for (auto const& vs : VPackArrayIterator(result)) {
|
for (auto const& vs : VPackArrayIterator(result)) {
|
||||||
VPackSlice const values = vs.resolveExternals();
|
VPackSlice const values = vs.resolveExternals();
|
||||||
|
|
||||||
|
if (!values.isObject()) {
|
||||||
|
// oops
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
VPackSlice server = values.get("server");
|
VPackSlice server = values.get("server");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// in an environment that is mixing 3.4 and previous versions, the following
|
// in an environment that is mixing 3.4 and previous versions, the following
|
||||||
// attributes may not be present. we don't want the statistics to give up
|
// attributes may not be present. we don't want the statistics to give up
|
||||||
// in this case, but simply ignore these errors
|
// in this case, but simply ignore these errors
|
||||||
VPackSlice v8Contexts = server.get("v8Context");
|
try {
|
||||||
serverV8available += extractNumber(v8Contexts, "availablePerSecond");
|
VPackSlice v8Contexts = server.get("v8Context");
|
||||||
serverV8busy += extractNumber(v8Contexts, "busyPerSecond");
|
serverV8available += extractNumber(v8Contexts, "availablePerSecond");
|
||||||
serverV8dirty += extractNumber(v8Contexts, "dirtyPerSecond");
|
serverV8busy += extractNumber(v8Contexts, "busyPerSecond");
|
||||||
serverV8free += extractNumber(v8Contexts, "freePerSecond");
|
serverV8dirty += extractNumber(v8Contexts, "dirtyPerSecond");
|
||||||
serverV8max += extractNumber(v8Contexts, "maxPerSecond");
|
serverV8free += extractNumber(v8Contexts, "freePerSecond");
|
||||||
|
serverV8max += extractNumber(v8Contexts, "maxPerSecond");
|
||||||
|
} catch (...) {
|
||||||
|
// if attribute "v8Context" is not present, simply do not count
|
||||||
|
}
|
||||||
|
|
||||||
VPackSlice threads = server.get("threads");
|
try {
|
||||||
serverThreadsRunning += extractNumber(threads, "runningPerSecond");
|
VPackSlice threads = server.get("threads");
|
||||||
serverThreadsWorking += extractNumber(threads, "workingPerSecond");
|
serverThreadsRunning += extractNumber(threads, "runningPerSecond");
|
||||||
serverThreadsBlocked += extractNumber(threads, "blockedPerSecond");
|
serverThreadsWorking += extractNumber(threads, "workingPerSecond");
|
||||||
serverThreadsQueued += extractNumber(threads, "queuedPerSecond");
|
serverThreadsBlocked += extractNumber(threads, "blockedPerSecond");
|
||||||
|
serverThreadsQueued += extractNumber(threads, "queuedPerSecond");
|
||||||
|
} catch (...) {
|
||||||
|
// if attribute "threads" is not present, simply do not count
|
||||||
|
}
|
||||||
|
|
||||||
VPackSlice system = values.get("system");
|
try {
|
||||||
systemMinorPageFaultsPerSecond += extractNumber(system, "minorPageFaultsPerSecond");
|
VPackSlice system = values.get("system");
|
||||||
systemMajorPageFaultsPerSecond += extractNumber(system, "majorPageFaultsPerSecond");
|
systemMinorPageFaultsPerSecond += extractNumber(system, "minorPageFaultsPerSecond");
|
||||||
systemUserTimePerSecond += extractNumber(system, "userTimePerSecond");
|
systemMajorPageFaultsPerSecond += extractNumber(system, "majorPageFaultsPerSecond");
|
||||||
systemSystemTimePerSecond += extractNumber(system, "systemTimePerSecond");
|
systemUserTimePerSecond += extractNumber(system, "userTimePerSecond");
|
||||||
systemResidentSize += extractNumber(system, "residentSize");
|
systemSystemTimePerSecond += extractNumber(system, "systemTimePerSecond");
|
||||||
systemVirtualSize += extractNumber(system, "virtualSize");
|
systemResidentSize += extractNumber(system, "residentSize");
|
||||||
systemNumberOfThreads += extractNumber(system, "numberOfThreads");
|
systemVirtualSize += extractNumber(system, "virtualSize");
|
||||||
|
systemNumberOfThreads += extractNumber(system, "numberOfThreads");
|
||||||
|
} catch (...) {
|
||||||
|
// if attribute "system" is not present, simply do not count
|
||||||
|
}
|
||||||
|
|
||||||
VPackSlice http = values.get("http");
|
try {
|
||||||
httpRequestsTotalPerSecond += extractNumber(http, "requestsTotalPerSecond");
|
VPackSlice http = values.get("http");
|
||||||
httpRequestsAsyncPerSecond += extractNumber(http, "requestsAsyncPerSecond");
|
httpRequestsTotalPerSecond += extractNumber(http, "requestsTotalPerSecond");
|
||||||
httpRequestsGetPerSecond += extractNumber(http, "requestsGetPerSecond");
|
httpRequestsAsyncPerSecond += extractNumber(http, "requestsAsyncPerSecond");
|
||||||
httpRequestsHeadPerSecond += extractNumber(http, "requestsHeadPerSecond");
|
httpRequestsGetPerSecond += extractNumber(http, "requestsGetPerSecond");
|
||||||
httpRequestsPostPerSecond += extractNumber(http, "requestsPostPerSecond");
|
httpRequestsHeadPerSecond += extractNumber(http, "requestsHeadPerSecond");
|
||||||
httpRequestsPutPerSecond += extractNumber(http, "requestsPutPerSecond");
|
httpRequestsPostPerSecond += extractNumber(http, "requestsPostPerSecond");
|
||||||
httpRequestsPatchPerSecond += extractNumber(http, "requestsPatchPerSecond");
|
httpRequestsPutPerSecond += extractNumber(http, "requestsPutPerSecond");
|
||||||
httpRequestsDeletePerSecond += extractNumber(http, "requestsDeletePerSecond");
|
httpRequestsPatchPerSecond += extractNumber(http, "requestsPatchPerSecond");
|
||||||
httpRequestsOptionsPerSecond += extractNumber(http, "requestsOptionsPerSecond");
|
httpRequestsDeletePerSecond += extractNumber(http, "requestsDeletePerSecond");
|
||||||
httpRequestsOtherPerSecond += extractNumber(http, "requestsOtherPerSecond");
|
httpRequestsOptionsPerSecond += extractNumber(http, "requestsOptionsPerSecond");
|
||||||
|
httpRequestsOtherPerSecond += extractNumber(http, "requestsOtherPerSecond");
|
||||||
|
} catch (...) {
|
||||||
|
// if attribute "http" is not present, simply do not count
|
||||||
|
}
|
||||||
|
|
||||||
VPackSlice client = values.get("client");
|
try {
|
||||||
clientHttpConnections += extractNumber(client, "httpConnections");
|
VPackSlice client = values.get("client");
|
||||||
clientBytesSentPerSecond += extractNumber(client, "bytesSentPerSecond");
|
clientHttpConnections += extractNumber(client, "httpConnections");
|
||||||
clientBytesReceivedPerSecond += extractNumber(client, "bytesReceivedPerSecond");
|
clientBytesSentPerSecond += extractNumber(client, "bytesSentPerSecond");
|
||||||
clientAvgTotalTime += extractNumber(client, "avgTotalTime");
|
clientBytesReceivedPerSecond += extractNumber(client, "bytesReceivedPerSecond");
|
||||||
clientAvgRequestTime += extractNumber(client, "avgRequestTime");
|
clientAvgTotalTime += extractNumber(client, "avgTotalTime");
|
||||||
clientAvgQueueTime += extractNumber(client, "avgQueueTime");
|
clientAvgRequestTime += extractNumber(client, "avgRequestTime");
|
||||||
clientAvgIoTime += extractNumber(client, "avgIoTime");
|
clientAvgQueueTime += extractNumber(client, "avgQueueTime");
|
||||||
|
clientAvgIoTime += extractNumber(client, "avgIoTime");
|
||||||
|
} catch (...) {
|
||||||
|
// if attribute "client" is not present, simply do not count
|
||||||
|
}
|
||||||
} catch (std::exception const& ex) {
|
} catch (std::exception const& ex) {
|
||||||
|
// should almost never happen now
|
||||||
LOG_TOPIC(WARN, Logger::STATISTICS) << "caught exception during statistics processing: " << ex.what();
|
LOG_TOPIC(WARN, Logger::STATISTICS) << "caught exception during statistics processing: " << ex.what();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue