MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / putStatement

Method putStatement

src/jrd/Monitoring.cpp:1224–1263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222
1223
1224void Monitoring::putStatement(SnapshotData::DumpRecord& record, const Statement* statement, const string& plan)
1225{
1226 fb_assert(statement);
1227
1228 record.reset(rel_mon_compiled_statements);
1229
1230 // compiled statement id
1231 record.storeInteger(f_mon_cmp_stmt_id, statement->getStatementId());
1232
1233 // sql text
1234 if (statement->sqlText)
1235 record.storeString(f_mon_cmp_stmt_sql_text, *statement->sqlText);
1236
1237 // explained plan
1238 if (plan.hasData())
1239 record.storeString(f_mon_cmp_stmt_expl_plan, plan);
1240
1241 // object name/type
1242 if (const auto routine = statement->getRoutine())
1243 {
1244 if (routine->getName().package.hasData())
1245 record.storeString(f_mon_cmp_stmt_pkg_name, routine->getName().package);
1246
1247 record.storeString(f_mon_cmp_stmt_name, routine->getName().identifier);
1248 record.storeInteger(f_mon_cmp_stmt_type, routine->getObjectType());
1249 }
1250 else if (!statement->triggerName.isEmpty())
1251 {
1252 record.storeString(f_mon_cmp_stmt_name, statement->triggerName);
1253 record.storeInteger(f_mon_cmp_stmt_type, obj_trigger);
1254 }
1255
1256 // statistics
1257 const int stat_id = fb_utils::genUniqueId();
1258 record.storeGlobalId(f_mon_cmp_stmt_stat_id, getGlobalId(stat_id));
1259
1260 record.write();
1261
1262 putMemoryUsage(record, statement->pool->getStatsGroup(), stat_id, stat_cmp_statement);
1263}
1264
1265
1266void Monitoring::putRequest(SnapshotData::DumpRecord& record, const Request* request,

Callers

nothing calls this directly

Calls 12

genUniqueIdFunction · 0.85
storeIntegerMethod · 0.80
getStatementIdMethod · 0.80
storeStringMethod · 0.80
getRoutineMethod · 0.80
storeGlobalIdMethod · 0.80
resetMethod · 0.45
hasDataMethod · 0.45
getNameMethod · 0.45
getObjectTypeMethod · 0.45
isEmptyMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected