The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 99d31977 authored by Alessio Netti's avatar Alessio Netti
Browse files

Changes to statistics MQTT suffixes

parent b9a68de8
......@@ -953,10 +953,10 @@ int main(int argc, char* const argv[]) {
if (settings.statisticsMqttPart.size() > 0) {
std::string statisticsMqttTopic = pluginSettings.mqttPrefix + settings.statisticsMqttPart;
std::list<SensorDataStoreReading> stats;
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/msgs"), end, msgCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/msgsRcvd"), end, msgCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/cachedQueries"), end, cachedQueryCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/dbQueries"), end, dbQueryCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/readings"), end, readingCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/readingsRcvd"), end, readingCtr));
stats.push_back(SensorDataStoreReading(SensorId(statisticsMqttTopic+"/hosts"), end, connectedHosts));
for (auto s: stats) {
mySensorDataStore->insert(s);
......
......@@ -211,9 +211,9 @@ void MQTTPusher::push() {
if (_statisticsMqttTopic.size() != 0) {
reading_t r = { (int64_t) msgCtr, ts };
int rc = MOSQ_ERR_SUCCESS;
rc+= mosquitto_publish(_mosq, NULL, std::string(_statisticsMqttTopic+"/msgs").c_str(), sizeof(reading_t), &r, _qosLevel, false);
rc+= mosquitto_publish(_mosq, NULL, std::string(_statisticsMqttTopic+"/msgsSent").c_str(), sizeof(reading_t), &r, _qosLevel, false);
r = { (int64_t) readingCtr, ts };
rc+= mosquitto_publish(_mosq, NULL, std::string(_statisticsMqttTopic+"/readings").c_str(), sizeof(reading_t), &r, _qosLevel, false);
rc+= mosquitto_publish(_mosq, NULL, std::string(_statisticsMqttTopic+"/readingsSent").c_str(), sizeof(reading_t), &r, _qosLevel, false);
if (rc != MOSQ_ERR_SUCCESS) {
LOGM(info) << "Error sending statistics via MQTT: " << mosquitto_strerror(rc);
_connected = false;
......
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