Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit da3cf5c4 authored by Alessio Netti's avatar Alessio Netti
Browse files

Adding missed queries counter to statistics

parent 16d19753
......@@ -93,6 +93,7 @@ uint64_t msgCtr;
uint64_t readingCtr;
uint64_t dbQueryCtr;
uint64_t cachedQueryCtr;
uint64_t missesQueryCtr;
SensorCache mySensorCache;
AnalyticsController* analyticsController;
DCDB::Connection* dcdbConn;
......@@ -204,6 +205,8 @@ bool sensorGroupQueryCallback(const std::vector<string>& names, const uint64_t s
reading.timestamp = r.timeStamp.getRaw();
buffer.push_back(reading);
}
} else {
missesQueryCtr += topics.size();
}
}
catch (const std::exception &e) {}
......@@ -909,6 +912,7 @@ int main(int argc, char* const argv[]) {
readingCtr = 0;
dbQueryCtr = 0;
cachedQueryCtr = 0;
missesQueryCtr = 0;
start = getTimestamp();
uint64_t lastCleanup = start;
......@@ -936,11 +940,12 @@ int main(int argc, char* const argv[]) {
elapsed = (float)(NS_TO_S(end) - NS_TO_S(start));
float aIns = ceil(((float)analyticsController->getReadingCtr()) / elapsed);
float cacheReq = ceil(((float)cachedQueryCtr) / elapsed);
float missesReq = ceil(((float)missesQueryCtr) / elapsed);
float dbReq = ceil(((float)dbQueryCtr) / elapsed);
float rIns = restAPISettings.enabled ? ceil(((float)httpsServer->getInfluxCounter()) / elapsed) : 0.0f;
float mIns = ceil(((float)readingCtr) / elapsed);
float mMsg = ceil(((float) msgCtr) / elapsed);
LOG(info) << "Performance: MQTT [" << std::fixed << std::setprecision(0) << mIns << " ins/s|" << mMsg << " msg/s] REST [" << rIns << " ins/s] Analytics [" << aIns << " ins/s] Cache [" << cacheReq << " req/s] DB [" << dbReq << " req/s]";
LOG(info) << "Performance: MQTT [" << std::fixed << std::setprecision(0) << mIns << " ins/s|" << mMsg << " msg/s] REST [" << rIns << " ins/s] Analytics [" << aIns << " ins/s] Cache [" << cacheReq << " req/s] DB [" << dbReq << " req/s] Miss [" << missesReq << " req/s]";
std::map<std::string, hostInfo_t> lastSeen = ms.collectLastSeen();
uint64_t connectedHosts = 0;
for (auto h: lastSeen) {
......@@ -955,6 +960,7 @@ int main(int argc, char* const argv[]) {
std::list<SensorDataStoreReading> stats;
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/msgsRcvd"), end, msgCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/cachedQueries"), end, cachedQueryCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/missedQueries"), end, missesQueryCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/dbQueries"), end, dbQueryCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/readingsRcvd"), end, readingCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/hosts"), end, connectedHosts));
......@@ -966,6 +972,7 @@ int main(int argc, char* const argv[]) {
msgCtr = 0;
cachedQueryCtr = 0;
missesQueryCtr = 0;
dbQueryCtr = 0;
readingCtr = 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment