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

Method putStatistics

src/jrd/Monitoring.cpp:1398–1468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1396
1397
1398void Monitoring::putStatistics(SnapshotData::DumpRecord& record, const RuntimeStatistics& statistics,
1399 int stat_id, int stat_group)
1400{
1401 // statistics id
1402 const auto id = getGlobalId(stat_id);
1403
1404 // physical I/O statistics
1405 record.reset(rel_mon_io_stats);
1406 record.storeGlobalId(f_mon_io_stat_id, id);
1407 record.storeInteger(f_mon_io_stat_group, stat_group);
1408 record.storeInteger(f_mon_io_page_reads, statistics.getValue(RuntimeStatistics::PAGE_READS));
1409 record.storeInteger(f_mon_io_page_writes, statistics.getValue(RuntimeStatistics::PAGE_WRITES));
1410 record.storeInteger(f_mon_io_page_fetches, statistics.getValue(RuntimeStatistics::PAGE_FETCHES));
1411 record.storeInteger(f_mon_io_page_marks, statistics.getValue(RuntimeStatistics::PAGE_MARKS));
1412 record.write();
1413
1414 // logical I/O statistics (global)
1415 record.reset(rel_mon_rec_stats);
1416 record.storeGlobalId(f_mon_rec_stat_id, id);
1417 record.storeInteger(f_mon_rec_stat_group, stat_group);
1418 record.storeInteger(f_mon_rec_seq_reads, statistics.getValue(RuntimeStatistics::RECORD_SEQ_READS));
1419 record.storeInteger(f_mon_rec_idx_reads, statistics.getValue(RuntimeStatistics::RECORD_IDX_READS));
1420 record.storeInteger(f_mon_rec_inserts, statistics.getValue(RuntimeStatistics::RECORD_INSERTS));
1421 record.storeInteger(f_mon_rec_updates, statistics.getValue(RuntimeStatistics::RECORD_UPDATES));
1422 record.storeInteger(f_mon_rec_deletes, statistics.getValue(RuntimeStatistics::RECORD_DELETES));
1423 record.storeInteger(f_mon_rec_backouts, statistics.getValue(RuntimeStatistics::RECORD_BACKOUTS));
1424 record.storeInteger(f_mon_rec_purges, statistics.getValue(RuntimeStatistics::RECORD_PURGES));
1425 record.storeInteger(f_mon_rec_expunges, statistics.getValue(RuntimeStatistics::RECORD_EXPUNGES));
1426 record.storeInteger(f_mon_rec_locks, statistics.getValue(RuntimeStatistics::RECORD_LOCKS));
1427 record.storeInteger(f_mon_rec_waits, statistics.getValue(RuntimeStatistics::RECORD_WAITS));
1428 record.storeInteger(f_mon_rec_conflicts, statistics.getValue(RuntimeStatistics::RECORD_CONFLICTS));
1429 record.storeInteger(f_mon_rec_bkver_reads, statistics.getValue(RuntimeStatistics::RECORD_BACKVERSION_READS));
1430 record.storeInteger(f_mon_rec_frg_reads, statistics.getValue(RuntimeStatistics::RECORD_FRAGMENT_READS));
1431 record.storeInteger(f_mon_rec_rpt_reads, statistics.getValue(RuntimeStatistics::RECORD_RPT_READS));
1432 record.storeInteger(f_mon_rec_imgc, statistics.getValue(RuntimeStatistics::RECORD_IMGC));
1433 record.write();
1434
1435 // logical I/O statistics (table wise)
1436
1437 for (RuntimeStatistics::Iterator iter = statistics.begin(); iter != statistics.end(); ++iter)
1438 {
1439 const auto rec_stat_id = getGlobalId(fb_utils::genUniqueId());
1440
1441 record.reset(rel_mon_tab_stats);
1442 record.storeGlobalId(f_mon_tab_stat_id, id);
1443 record.storeInteger(f_mon_tab_stat_group, stat_group);
1444 record.storeTableId(f_mon_tab_name, (*iter).getRelationId());
1445 record.storeGlobalId(f_mon_tab_rec_stat_id, rec_stat_id);
1446 record.write();
1447
1448 record.reset(rel_mon_rec_stats);
1449 record.storeGlobalId(f_mon_rec_stat_id, rec_stat_id);
1450 record.storeInteger(f_mon_rec_stat_group, stat_group);
1451 record.storeInteger(f_mon_rec_seq_reads, (*iter).getCounter(RuntimeStatistics::RECORD_SEQ_READS));
1452 record.storeInteger(f_mon_rec_idx_reads, (*iter).getCounter(RuntimeStatistics::RECORD_IDX_READS));
1453 record.storeInteger(f_mon_rec_inserts, (*iter).getCounter(RuntimeStatistics::RECORD_INSERTS));
1454 record.storeInteger(f_mon_rec_updates, (*iter).getCounter(RuntimeStatistics::RECORD_UPDATES));
1455 record.storeInteger(f_mon_rec_deletes, (*iter).getCounter(RuntimeStatistics::RECORD_DELETES));

Callers

nothing calls this directly

Calls 11

genUniqueIdFunction · 0.85
storeGlobalIdMethod · 0.80
storeIntegerMethod · 0.80
storeTableIdMethod · 0.80
getCounterMethod · 0.80
resetMethod · 0.45
getValueMethod · 0.45
writeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getRelationIdMethod · 0.45

Tested by

no test coverage detected