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

Method read_stats

src/burp/burp.cpp:2794–2836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2792}
2793
2794void BurpGlobals::read_stats(SINT64* stats)
2795{
2796 if (!db_handle)
2797 return;
2798
2799 const UCHAR info[] =
2800 {
2801 isc_info_reads,
2802 isc_info_writes
2803 };
2804
2805 FbLocalStatus status;
2806 UCHAR buffer[sizeof(info) * (1 + 2 + 8) + 2];
2807
2808 db_handle->getInfo(&status, sizeof(info), info, sizeof(buffer), buffer);
2809
2810 UCHAR* p = buffer, *const e = buffer + sizeof(buffer);
2811 while (p < e)
2812 {
2813 int flag = -1;
2814 switch (*p)
2815 {
2816 case isc_info_reads:
2817 flag = READS;
2818 break;
2819
2820 case isc_info_writes:
2821 flag = WRITES;
2822 break;
2823
2824 case isc_info_end:
2825 default:
2826 p = e;
2827 }
2828
2829 if (flag != -1)
2830 {
2831 const int len = gds__vax_integer(p + 1, 2);
2832 stats[flag] = isc_portable_integer((ISC_UCHAR*) p + 1 + 2, len);
2833 p += len + 3;
2834 }
2835 }
2836}
2837
2838void BurpGlobals::print_stats(USHORT number)
2839{

Callers

nothing calls this directly

Calls 1

getInfoMethod · 0.45

Tested by

no test coverage detected