Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing 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 6468b5e4 authored by Michael Ott's avatar Michael Ott
Browse files

Make interval for printing statistics configurable.

parent c9b125ce
......@@ -87,7 +87,6 @@ using namespace std;
int keepRunning;
int retCode = EXIT_SUCCESS;
bool statistics;
uint64_t msgCtr;
uint64_t pmsgCtr;
uint64_t readingCtr;
......@@ -652,7 +651,7 @@ int main(int argc, char* const argv[]) {
settings.daemonize = 1;
break;
case 's':
settings.statistics = 1;
settings.statisticsInterval = 1;
break;
case 'x':
settings.validateConfig = true;
......@@ -773,7 +772,7 @@ int main(int argc, char* const argv[]) {
LOG(info) << " MessageThreads: " << settings.messageThreads;
LOG(info) << " MessageSlots: " << settings.messageSlots;
LOG(info) << " Daemonize: " << (settings.daemonize ? "Enabled" : "Disabled");
LOG(info) << " Statistics: " << (settings.statistics ? "Enabled" : "Disabled");
LOG(info) << " StatisticsInterval: " << settings.statisticsInterval << " [s]";
LOG(info) << " MQTT-prefix: " << pluginSettings.mqttPrefix;
LOG(info) << " Auto-publish: " << (pluginSettings.autoPublish ? "Enabled" : "Disabled");
LOG(info) << " Write-Dir: " << pluginSettings.tempdir;
......@@ -852,6 +851,8 @@ int main(int argc, char* const argv[]) {
gettimeofday(&start, NULL);
uint64_t lastCleanup = start.tv_sec;
uint64_t lastStats = start.tv_sec;
uint64_t sleepInterval = (settings.statisticsInterval > 0) ? settings.statisticsInterval : 60;
LOG(info) << "Collect Agent running...";
while(keepRunning) {
......@@ -863,19 +864,21 @@ int main(int argc, char* const argv[]) {
LOG(info) << "Cache: purged " << purged << " obsolete entries";
}
sleep(60);
/* not really thread safe but will do the job */
gettimeofday(&end, NULL);
elapsed = (end.tv_sec - start.tv_sec) * 1000.0;
elapsed += (end.tv_usec - start.tv_usec) / 1000.0;
float publish = msgCtr?(pmsgCtr*100.0)/msgCtr:0;
if (settings.statistics && keepRunning) {
LOG(info) << "Performance: " << (readingCtr/elapsed)*1000.0 << " inserts/s, " << (msgCtr/elapsed)*1000.0 << " messages/s (" << publish << "% PUBLISH)";
LOG(info) << "Analytics Performance: " << (analyticsController->getReadingCtr()/elapsed)*1000.0 << " inserts/s ";
}
msgCtr = 0;
pmsgCtr = 0;
readingCtr = 0;
sleep(sleepInterval);
if((settings.statisticsInterval > 0) && keepRunning) {
/* not really thread safe but will do the job */
gettimeofday(&end, NULL);
elapsed = (end.tv_sec - start.tv_sec) * 1000.0;
elapsed += (end.tv_usec - start.tv_usec) / 1000.0;
float publish = msgCtr?(pmsgCtr*100.0)/msgCtr:0;
LOG(info) << "Performance: " << (readingCtr/elapsed)*1000.0 << " inserts/s, " << (msgCtr/elapsed)*1000.0 << " messages/s (" << publish << "% PUBLISH)";
LOG(info) << "Analytics Performance: " << (analyticsController->getReadingCtr()/elapsed)*1000.0 << " inserts/s ";
msgCtr = 0;
pmsgCtr = 0;
readingCtr = 0;
lastStats = start.tv_sec;
}
}
LOG(info) << "Stopping...";
......
......@@ -194,7 +194,7 @@ public:
// Global configuration members directly accessible from the class
bool validateConfig = false;
bool daemonize = false;
bool statistics = false;
int statisticsInterval = 60;
uint64_t threads = DEFAULT_THREADS;
int logLevelFile = -1;
int logLevelCmd = DEFAULT_LOGLEVEL;
......
......@@ -79,8 +79,8 @@ void GlobalConfiguration::readConfig() {
validateConfig = to_bool(global.second.data());
} else if (boost::iequals(global.first, "verbosity")) {
logLevelFile = stoi(global.second.data());
} else if (boost::iequals(global.first, "statistics")) {
statistics = to_bool(global.second.data());
} else if (boost::iequals(global.first, "statisticsInterval")) {
statisticsInterval = stoi(global.second.data());
} else if (!readAdditionalValues(global)) {
LOG(warning) << " Value \"" << global.first << "\" not recognized. Omitting";
}
......
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