| 1222 | |
| 1223 | |
| 1224 | void 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 | |
| 1266 | void Monitoring::putRequest(SnapshotData::DumpRecord& record, const Request* request, |
nothing calls this directly
no test coverage detected