|
26 | 26 | #include <time.h> |
27 | 27 | #include <string.h> |
28 | 28 | #include <sys/mman.h> |
| 29 | +#include <inttypes.h> |
29 | 30 |
|
30 | 31 | #include "DataBlock.h" |
31 | 32 | #include "DataBlockContainer.h" |
@@ -161,6 +162,7 @@ class Readout |
161 | 162 | std::string cfgLogbookApiToken; |
162 | 163 | int cfgLogbookUpdateInterval; |
163 | 164 | std::string cfgDatabaseCxParams; |
| 165 | + int cfgDatabaseVerbose; |
164 | 166 | std::string cfgTimeframeServerUrl; |
165 | 167 | int cfgVerbose = 0; |
166 | 168 | int cfgMaxMsgError; // maximum number of error messages before stopping run |
@@ -274,6 +276,7 @@ int Readout::init(int argc, char* argv[]) |
274 | 276 | cfgDefaults.getOptionalValue<std::string>(cfgDefaultsEntryPoint + ".statsPublishAddress", cfgStatsPublishAddress, cfgStatsPublishAddress); |
275 | 277 | cfgDefaults.getOptionalValue<double>(cfgDefaultsEntryPoint + ".statsPublishInterval", cfgStatsPublishInterval, cfgStatsPublishInterval); |
276 | 278 | cfgDefaults.getOptionalValue<std::string>(cfgDefaultsEntryPoint + ".db", cfgDatabaseCxParams); |
| 279 | + cfgDefaults.getOptionalValue<int>(cfgDefaultsEntryPoint + ".dbVerbose", cfgDatabaseVerbose); |
277 | 280 | } |
278 | 281 | catch(...) { |
279 | 282 | //initLogs.push_back({LogWarningSupport_(3100), std::string("Error loading defaults")}); |
@@ -335,7 +338,7 @@ int Readout::init(int argc, char* argv[]) |
335 | 338 | try { |
336 | 339 | dbHandle=std::make_unique<ReadoutDatabase>(cfgDatabaseCxParams.c_str()); |
337 | 340 | if (dbHandle == nullptr) { throw __LINE__; } |
338 | | - //dbHandle->verbose = 1; |
| 341 | + dbHandle->verbose = cfgDatabaseVerbose; |
339 | 342 | initLogs.push_back({LogInfoSupport, "Database connected "}); |
340 | 343 | } |
341 | 344 | catch(...) { |
@@ -1220,6 +1223,13 @@ int Readout::stop() |
1220 | 1223 | // publish final logbook statistics |
1221 | 1224 | publishLogbookStats(); |
1222 | 1225 |
|
| 1226 | + // publish some final counters |
| 1227 | + theLog.log(LogInfoDevel_(3003), "Final counters: timeframes = %" PRIu64 " readout = %s recorded = %s", |
| 1228 | + gReadoutStats.counters.numberOfSubtimeframes.load(), |
| 1229 | + NumberOfBytesToString(gReadoutStats.counters.bytesReadout.load(), "bytes").c_str(), |
| 1230 | + NumberOfBytesToString(gReadoutStats.counters.bytesRecorded.load(),"bytes").c_str() |
| 1231 | + ); |
| 1232 | + |
1223 | 1233 | theLog.log(LogInfoSupport_(3005), "Readout completed STOP"); |
1224 | 1234 | gReadoutStats.counters.state = stringToUint64("ready"); |
1225 | 1235 | gReadoutStats.counters.notify++; |
|
0 commit comments