242 if ((nEventRows == 0) && (nModuleRows == 0)) {
246 if (nEventRows == 0 && nModuleRows != 0) {
248 "Malformed TimeTracker database. The TimeEvent table is empty, but\n" 249 "the TimeModule table is not. This can happen if an exception has\n" 250 "been thrown from a module while processing the first event. Any\n" 251 "saved database file is suspect and should not be used."};
259 string const fullEventTime_ddl =
260 "CREATE TABLE temp.fullEventTime AS " 261 "SELECT Run,Subrun,Event,SUM(Time) AS FullEventTime FROM (" 262 " SELECT Run,Subrun,Event,Time FROM TimeEvent" 264 " SELECT Run,Subrun,Event,Time FROM TimeModule WHERE ModuleType " 267 " SELECT Run,Subrun,Event,Time FROM TimeSource" 268 ") GROUP BY Run,Subrun,Event";
272 "Full event",
"",
"", *
db_,
"temp.fullEventTime",
"FullEventTime"};
277 vector<Statistics> modStats;
278 modStats.emplace_back(
279 "source",
sourceType_ +
"(read)",
"", *
db_,
"TimeSource",
"Time");
280 for (
auto const&
row : r) {
281 auto const& [path, mod_label, mod_type] =
row;
284 .from(*
db_,
"TimeModule")
285 .where(
"Path='"s + path +
"'"s +
" AND ModuleLabel='"s +
286 mod_label +
"'"s +
" AND ModuleType='"s +
288 modStats.emplace_back(
289 path, mod_label, mod_type, *
db_,
"temp.tmpModTable",
"Time");
void logToDestination_(Statistics const &evt, vector< Statistics > const &modules)
timeEvent_t timeEventTable_
T unique_value(query_result< T > const &r)
auto select_distinct(T const &...t)
std::string const & name() const
void create_table_as(std::string const &tablename, SelectStmt const &stmt)
timeModule_t timeModuleTable_
unique_ptr< cet::sqlite::Connection > const db_
timeSource_t timeSourceTable_
auto select(T const &...t)
void drop_table(sqlite3 *db, std::string const &tablename)
void exec(sqlite3 *db, std::string const &ddl)
MaybeLogger_< ELseverityLevel::ELsev_severe, true > LogAbsolute