MySQL 8.1.0
Source Code Documentation
pfs_stat.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef PFS_STAT_H
24#define PFS_STAT_H
25
26#include <assert.h>
27#include <algorithm>
28#include <atomic>
29
30#include "my_sys.h"
31#include "my_systime.h"
32#include "sql/sql_const.h"
35/* memcpy */
36#include "string.h"
37
39
40/**
41 @file storage/perfschema/pfs_stat.h
42 Statistics (declarations).
43*/
44
45/**
46 @addtogroup performance_schema_buffers
47 @{
48*/
49
50/** Single statistic. */
52 /** Count of values. */
54 /** Sum of values. */
56 /** Minimum value. */
58 /** Maximum value. */
60
62 m_count = 0;
63 m_sum = 0;
64 m_min = ULLONG_MAX;
65 m_max = 0;
66 }
67
68 inline void reset() {
69 m_count = 0;
70 m_sum = 0;
71 m_min = ULLONG_MAX;
72 m_max = 0;
73 }
74
75 inline bool has_timed_stats() const { return (m_min <= m_max); }
76
77 inline void aggregate(const PFS_single_stat *stat) {
78 if (stat->m_count != 0) {
79 m_count += stat->m_count;
80 m_sum += stat->m_sum;
81 if (unlikely(m_min > stat->m_min)) {
82 m_min = stat->m_min;
83 }
84 if (unlikely(m_max < stat->m_max)) {
85 m_max = stat->m_max;
86 }
87 }
88 }
89
90 inline void aggregate_no_check(const PFS_single_stat *stat) {
91 m_count += stat->m_count;
92 m_sum += stat->m_sum;
93 if (unlikely(m_min > stat->m_min)) {
94 m_min = stat->m_min;
95 }
96 if (unlikely(m_max < stat->m_max)) {
97 m_max = stat->m_max;
98 }
99 }
100
101 inline void aggregate_counted() { m_count++; }
102
104
105 inline void aggregate_value(ulonglong value) {
106 m_count++;
107 m_sum += value;
108 if (unlikely(m_min > value)) {
109 m_min = value;
110 }
111 if (unlikely(m_max < value)) {
112 m_max = value;
113 }
114 }
115
117 m_count += count;
118 m_sum += value;
119 if (unlikely(m_min > value)) {
120 m_min = value;
121 }
122 if (unlikely(m_max < value)) {
123 m_max = value;
124 }
125 }
126};
127
128/** Combined statistic. */
130 /** Byte count statistics */
132
133 /** Aggregate wait stats, event count and byte count */
134 inline void aggregate(const PFS_byte_stat *stat) {
135 if (stat->m_count != 0) {
137 m_bytes += stat->m_bytes;
138 }
139 }
140
141 /** Aggregate wait stats, event count and byte count */
142 inline void aggregate_no_check(const PFS_byte_stat *stat) {
144 m_bytes += stat->m_bytes;
145 }
146
147 /** Aggregate individual wait time, event count and byte count */
148 inline void aggregate(ulonglong wait, ulonglong bytes) {
150 m_bytes += bytes;
151 }
152
153 /** Aggregate wait stats and event count */
154 inline void aggregate_waits(const PFS_byte_stat *stat) {
156 }
157
158 /** Aggregate event count and byte count */
160
161 /** Aggregate event count and byte count */
162 inline void aggregate_counted(ulonglong bytes) {
164 m_bytes += bytes;
165 }
166
168
169 inline void reset() {
171 m_bytes = 0;
172 }
173};
174
175/** Statistics for mutex usage. */
177 /** Wait statistics. */
179#ifdef PFS_LATER
180 /**
181 Lock statistics.
182 This statistic is not exposed in user visible tables yet.
183 */
184 PFS_single_stat m_lock_stat;
185#endif
186
187 inline void aggregate(const PFS_mutex_stat *stat) {
189#ifdef PFS_LATER
190 m_lock_stat.aggregate(&stat->m_lock_stat);
191#endif
192 }
193
194 inline void reset() {
196#ifdef PFS_LATER
197 m_lock_stat.reset();
198#endif
199 }
200};
201
202/** Statistics for rwlock usage. */
204 /** Wait statistics. */
206#ifdef PFS_LATER
207 /**
208 RWLock read lock usage statistics.
209 This statistic is not exposed in user visible tables yet.
210 */
211 PFS_single_stat m_read_lock_stat;
212 /**
213 RWLock write lock usage statistics.
214 This statistic is not exposed in user visible tables yet.
215 */
216 PFS_single_stat m_write_lock_stat;
217#endif
218
219 inline void aggregate(const PFS_rwlock_stat *stat) {
221#ifdef PFS_LATER
222 m_read_lock_stat.aggregate(&stat->m_read_lock_stat);
223 m_write_lock_stat.aggregate(&stat->m_write_lock_stat);
224#endif
225 }
226
227 inline void reset() {
229#ifdef PFS_LATER
230 m_read_lock_stat.reset();
231 m_write_lock_stat.reset();
232#endif
233 }
234};
235
236/** Statistics for conditions usage. */
238 /** Wait statistics. */
240#ifdef PFS_LATER
241 /**
242 Number of times a condition was signalled.
243 This statistic is not exposed in user visible tables yet.
244 */
245 ulonglong m_signal_count;
246 /**
247 Number of times a condition was broadcast.
248 This statistic is not exposed in user visible tables yet.
249 */
250 ulonglong m_broadcast_count;
251#endif
252
253 inline void aggregate(const PFS_cond_stat *stat) {
255#ifdef PFS_LATER
256 m_signal_count += stat->m_signal_count;
257 m_broadcast_count += stat->m_broadcast_count;
258#endif
259 }
260
261 inline void reset() {
263#ifdef PFS_LATER
264 m_signal_count = 0;
265 m_broadcast_count = 0;
266#endif
267 }
268};
269
270/** Statistics for FILE I/O. Used for both waits and byte counts. */
272 /** READ statistics */
274 /** WRITE statistics */
276 /** Miscellaneous statistics */
278
279 inline void reset() {
280 m_read.reset();
281 m_write.reset();
282 m_misc.reset();
283 }
284
285 inline void aggregate(const PFS_file_io_stat *stat) {
286 m_read.aggregate(&stat->m_read);
287 m_write.aggregate(&stat->m_write);
288 m_misc.aggregate(&stat->m_misc);
289 }
290
291 /* Sum waits and byte counts */
292 inline void sum(PFS_byte_stat *stat) {
293 stat->aggregate(&m_read);
294 stat->aggregate(&m_write);
295 stat->aggregate(&m_misc);
296 }
297
298 /* Sum waits only */
299 inline void sum_waits(PFS_single_stat *stat) {
300 stat->aggregate(&m_read);
301 stat->aggregate(&m_write);
302 stat->aggregate(&m_misc);
303 }
304};
305
306/** Statistics for FILE usage. */
308 /** Number of current open handles. */
310 /** File I/O statistics. */
312
313 inline void aggregate(const PFS_file_stat *stat) {
315 }
316
317 /** Reset file statistics. */
318 inline void reset() { m_io_stat.reset(); }
319};
320
321/** Statistics for stage usage. */
324
325 inline void reset() { m_timer1_stat.reset(); }
326
328
329 inline void aggregate_value(ulonglong value) {
331 }
332
333 inline void aggregate(const PFS_stage_stat *stat) {
335 }
336};
337
338/** Statistics for stored program usage. */
341
342 inline void reset() { m_timer1_stat.reset(); }
343
345
346 inline void aggregate_value(ulonglong value) {
348 }
349
350 inline void aggregate(const PFS_stage_stat *stat) {
352 }
353};
354
355/** Statistics for prepared statement usage. */
358
359 inline void reset() { m_timer1_stat.reset(); }
360
362
363 inline void aggregate_value(ulonglong value) {
365 }
366
367 inline void aggregate(PFS_stage_stat *stat) {
369 }
370};
371
372/**
373 Statistics for statement usage.
374*/
396 /**
397 CPU TIME.
398 Expressed in STORAGE units (nanoseconds).
399 */
404
405 void reset() { new (this) PFS_statement_stat(); }
406
408
411 }
412
413 void aggregate_memory_size(size_t controlled_size, size_t total_size) {
414 if (controlled_size > m_max_controlled_memory) {
415 m_max_controlled_memory = controlled_size;
416 }
417 if (total_size > m_max_total_memory) {
418 m_max_total_memory = total_size;
419 }
420 }
421
422 void aggregate(const PFS_statement_stat *stat) {
423 if (stat->m_timer1_stat.m_count != 0) {
425
429 m_lock_time += stat->m_lock_time;
430 m_rows_sent += stat->m_rows_sent;
440 m_sort_range += stat->m_sort_range;
441 m_sort_rows += stat->m_sort_rows;
442 m_sort_scan += stat->m_sort_scan;
445 m_cpu_time += stat->m_cpu_time;
448 }
451 }
453 }
454 }
455};
456
457/** Statistics for transaction usage. */
461
465
470 }
471
472 ulonglong count() const {
474 }
475
476 inline void reset() {
482 }
483
484 inline void aggregate(const PFS_transaction_stat *stat) {
490 }
491};
492
493/** Statistics for a server error. */
497 /** First and last seen timestamps.*/
500
502 m_count = 0;
503 m_handled_count = 0;
504 m_first_seen = 0;
505 m_last_seen = 0;
506 }
507
508 ulonglong count() const { return m_count; }
509
510 inline void reset() {
511 m_count = 0;
512 m_handled_count = 0;
513 m_first_seen = 0;
514 m_last_seen = 0;
515 }
516
517 inline void aggregate_count(int error_operation) {
519 if (m_first_seen == 0) {
521 }
522
523 switch (error_operation) {
525 m_count++;
526 break;
529 m_count--;
530 break;
531 default:
532 /* It must not be reached. */
533 assert(0);
534 break;
535 }
536 }
537
538 inline void aggregate(const PFS_error_single_stat *stat) {
539 if (stat->m_count == 0 && stat->m_handled_count == 0) {
540 return;
541 }
542
543 m_count += stat->m_count;
545
546 if (m_first_seen == 0 || stat->m_first_seen < m_first_seen) {
548 }
549 if (stat->m_last_seen > m_last_seen) {
550 m_last_seen = stat->m_last_seen;
551 }
552 }
553};
554
555/** Statistics for all server errors. */
557 /** The number of errors, including +1 for the NULL row. */
560
562
563 const PFS_error_single_stat *get_stat(uint error_index) const {
564 return &m_stat[error_index];
565 }
566
567 ulonglong count() const {
568 ulonglong total = 0;
569 for (uint i = 0; i < m_max_errors; i++) {
570 total += m_stat[i].count();
571 }
572 return total;
573 }
574
575 ulonglong count(uint error_index) const {
576 return m_stat[error_index].count();
577 }
578
579 inline void init(PFS_builtin_memory_class *memory_class, size_t max_errors) {
580 if (max_errors == 0) {
581 return;
582 }
583
584 m_max_errors = max_errors;
585 /* Allocate memory for errors' stats. The NULL row is already included. */
586 m_stat = PFS_MALLOC_ARRAY(memory_class, m_max_errors,
587 sizeof(PFS_error_single_stat),
589 reset();
590 }
591
592 inline void cleanup(PFS_builtin_memory_class *memory_class) {
593 if (m_stat == nullptr) {
594 return;
595 }
596
598 m_stat);
599 m_stat = nullptr;
600 }
601
602 inline void reset() {
603 if (m_stat == nullptr) {
604 return;
605 }
606
607 for (uint i = 0; i < m_max_errors; i++) {
608 m_stat[i].reset();
609 }
610 }
611
612 inline void aggregate_count(int error_index, int error_operation) {
613 if (m_stat == nullptr) {
614 return;
615 }
616
617 PFS_error_single_stat *stat = &m_stat[error_index];
618 stat->aggregate_count(error_operation);
619 }
620
621 inline void aggregate(const PFS_error_single_stat *stat, uint error_index) {
622 if (m_stat == nullptr) {
623 return;
624 }
625
626 assert(error_index < m_max_errors);
627 m_stat[error_index].aggregate(stat);
628 }
629
630 inline void aggregate(const PFS_error_stat *stat) {
631 if (m_stat == nullptr) {
632 return;
633 }
634
635 /*
636 Sizes can be different, for example when aggregating
637 per session statistics into global statistics.
638 */
639 const size_t common_max = std::min(m_max_errors, stat->m_max_errors);
640 for (uint i = 0; i < common_max; i++) {
641 m_stat[i].aggregate(&stat->m_stat[i]);
642 }
643 }
644};
645
646/** Single table I/O statistic. */
649 /** FETCH statistics */
651 /** INSERT statistics */
653 /** UPDATE statistics */
655 /** DELETE statistics */
657
659
660 inline void reset() {
661 m_has_data = false;
662 m_fetch.reset();
663 m_insert.reset();
664 m_update.reset();
665 m_delete.reset();
666 }
667
668 inline void aggregate(const PFS_table_io_stat *stat) {
669 if (stat->m_has_data) {
670 m_has_data = true;
671 m_fetch.aggregate(&stat->m_fetch);
675 }
676 }
677
678 inline void sum(PFS_single_stat *result) {
679 if (m_has_data) {
680 result->aggregate(&m_fetch);
681 result->aggregate(&m_insert);
682 result->aggregate(&m_update);
683 result->aggregate(&m_delete);
684 }
685 }
686};
687
689 /* Locks from enum thr_lock */
698
699 /* Locks for handler::ha_external_lock() */
702
703 PFS_TL_NONE = 99
705
706#define COUNT_PFS_TL_LOCK_TYPE 10
707
708/** Statistics for table locks. */
711
712 inline void reset() {
715 for (; pfs < pfs_last; pfs++) {
716 pfs->reset();
717 }
718 }
719
720 inline void aggregate(const PFS_table_lock_stat *stat) {
723 const PFS_single_stat *pfs_from = &stat->m_stat[0];
724 for (; pfs < pfs_last; pfs++, pfs_from++) {
725 pfs->aggregate(pfs_from);
726 }
727 }
728
729 inline void sum(PFS_single_stat *result) {
732 for (; pfs < pfs_last; pfs++) {
733 result->aggregate(pfs);
734 }
735 }
736};
737
738/** Statistics for TABLE usage. */
740 /**
741 Statistics, per index.
742 Each index stat is in [0, MAX_INDEXES-1],
743 stats when using no index are in [MAX_INDEXES].
744 */
746
747 /**
748 Statistics, per lock type.
749 */
751
752 /** Reset table I/O statistic. */
753 inline void reset_io() {
755 PFS_table_io_stat *stat_last = &m_index_stat[MAX_INDEXES + 1];
756 for (; stat < stat_last; stat++) {
757 stat->reset();
758 }
759 }
760
761 /** Reset table lock statistic. */
762 inline void reset_lock() { m_lock_stat.reset(); }
763
764 /** Reset table statistic. */
765 inline void reset() {
766 reset_io();
767 reset_lock();
768 }
769
770 inline void fast_reset_io() {
772 }
773
774 inline void fast_reset_lock() {
776 }
777
778 inline void fast_reset() { memcpy(this, &g_reset_template, sizeof(*this)); }
779
780 inline void aggregate_io(const PFS_table_stat *stat, uint key_count) {
781 PFS_table_io_stat *to_stat;
782 PFS_table_io_stat *to_stat_last;
783 const PFS_table_io_stat *from_stat;
784
785 assert(key_count <= MAX_INDEXES);
786
787 /* Aggregate stats for each index, if any */
788 to_stat = &m_index_stat[0];
789 to_stat_last = to_stat + key_count;
790 from_stat = &stat->m_index_stat[0];
791 for (; to_stat < to_stat_last; from_stat++, to_stat++) {
792 to_stat->aggregate(from_stat);
793 }
794
795 /* Aggregate stats for the table */
796 to_stat = &m_index_stat[MAX_INDEXES];
797 from_stat = &stat->m_index_stat[MAX_INDEXES];
798 to_stat->aggregate(from_stat);
799 }
800
801 inline void aggregate_lock(const PFS_table_stat *stat) {
803 }
804
805 inline void aggregate(const PFS_table_stat *stat, uint key_count) {
806 aggregate_io(stat, key_count);
807 aggregate_lock(stat);
808 }
809
810 inline void sum_io(PFS_single_stat *result, uint key_count) {
811 PFS_table_io_stat *stat;
812 PFS_table_io_stat *stat_last;
813
814 assert(key_count <= MAX_INDEXES);
815
816 /* Sum stats for each index, if any */
817 stat = &m_index_stat[0];
818 stat_last = stat + key_count;
819 for (; stat < stat_last; stat++) {
820 stat->sum(result);
821 }
822
823 /* Sum stats for the table */
825 }
826
828
829 inline void sum(PFS_single_stat *result, uint key_count) {
830 sum_io(result, key_count);
832 }
833
835};
836
837/** Statistics for SOCKET I/O. Used for both waits and byte counts. */
839 /** READ statistics */
841 /** WRITE statistics */
843 /** Miscellaneous statistics */
845
846 inline void reset() {
847 m_read.reset();
848 m_write.reset();
849 m_misc.reset();
850 }
851
852 inline void aggregate(const PFS_socket_io_stat *stat) {
853 m_read.aggregate(&stat->m_read);
854 m_write.aggregate(&stat->m_write);
855 m_misc.aggregate(&stat->m_misc);
856 }
857
858 /* Sum waits and byte counts */
859 inline void sum(PFS_byte_stat *stat) {
860 stat->aggregate(&m_read);
861 stat->aggregate(&m_write);
862 stat->aggregate(&m_misc);
863 }
864
865 /* Sum waits only */
866 inline void sum_waits(PFS_single_stat *stat) {
867 stat->aggregate(&m_read);
868 stat->aggregate(&m_write);
869 stat->aggregate(&m_misc);
870 }
871};
872
873/** Statistics for SOCKET usage. */
875 /** Socket timing and byte count statistics per operation */
877
878 /** Reset socket statistics. */
879 inline void reset() { m_io_stat.reset(); }
880};
881
885};
886
890};
891
892/**
893 Memory statistics.
894 Conceptually, the following statistics are maintained:
895 - CURRENT_COUNT_USED,
896 - LOW_COUNT_USED,
897 - HIGH_COUNT_USED
898 - CURRENT_SIZE_USED,
899 - LOW_SIZE_USED,
900 - HIGH_SIZE_USED
901 Now, the implementation keeps different counters,
902 which are easier (less overhead) to maintain while
903 collecting statistics.
904 Invariants are as follows:
905 CURRENT_COUNT_USED = @c m_alloc_count - @c m_free_count
906 LOW_COUNT_USED + @c m_free_count_capacity = CURRENT_COUNT_USED
907 CURRENT_COUNT_USED + @c m_alloc_count_capacity = HIGH_COUNT_USED
908 CURRENT_SIZE_USED = @c m_alloc_size - @c m_free_size
909 LOW_SIZE_USED + @c m_free_size_capacity = CURRENT_SIZE_USED
910 CURRENT_SIZE_USED + @c m_alloc_size_capacity = HIGH_SIZE_USED
911*/
913 bool m_used;
914
919
924
925 void reset();
926
927 void rebase();
928
931
934};
935
937 std::atomic<bool> m_used;
938
939 std::atomic<size_t> m_alloc_count;
940 std::atomic<size_t> m_free_count;
941 std::atomic<size_t> m_alloc_size;
942 std::atomic<size_t> m_free_size;
943
944 std::atomic<size_t> m_alloc_count_capacity;
945 std::atomic<size_t> m_free_count_capacity;
946 std::atomic<size_t> m_alloc_size_capacity;
947 std::atomic<size_t> m_free_size_capacity;
948
949 void reset();
950
951 void rebase();
952
953 void count_builtin_alloc(size_t size);
954
955 void count_builtin_free(size_t size);
956
957 inline void count_global_alloc(size_t size) { count_builtin_alloc(size); }
958
959 inline void count_global_free(size_t size) { count_builtin_free(size); }
960
963
966
967 /**
968 Expand the high water marks.
969 @param [in] delta High watermark increments to apply
970 @param [in] delta_buffer Working buffer
971 @return High watermark increments to carry to the parent if any, or
972nullptr.
973 */
975 const PFS_memory_stat_alloc_delta *delta,
976 PFS_memory_stat_alloc_delta *delta_buffer);
977
978 /**
979 Expand the low water marks.
980 @param [in] delta Low watermark decrements to apply
981 @param [in] delta_buffer Working buffer
982 @return Low watermark decrements to carry to the parent if any, or
983nullptr.
984 */
986 const PFS_memory_stat_free_delta *delta,
987 PFS_memory_stat_free_delta *delta_buffer);
988};
989
995
1000
1003
1008
1009 void reset();
1010
1011 void normalize(bool global);
1012};
1013
1015 /** The current memory size allocated. */
1016 size_t m_size;
1017 /** The maximum memory size allocated, for a sub statement. */
1019 /** The maximum memory size allocated, for a statement. */
1021 /** The maximum memory size allocated, for this session. */
1023
1024 void reset() {
1025 m_size = 0;
1026 m_max_local_size = 0;
1027 m_max_stmt_size = 0;
1029 }
1030
1034 }
1037 }
1038
1039 void end_top_statement(size_t *stmt_size) {
1042 }
1043 *stmt_size = m_max_stmt_size;
1044 }
1045
1046 void start_nested_statement(size_t *local_size_start,
1047 size_t *stmt_size_start) {
1050 }
1053 }
1054 *local_size_start = m_size;
1056
1057 /* PUSH m_max_stmt_size = m_size */
1058 *stmt_size_start = m_max_stmt_size;
1060 }
1061
1062 void end_nested_statement(size_t local_size_start, size_t stmt_size_start,
1063 size_t *stmt_size) {
1066 }
1069 }
1070 if (m_max_stmt_size > local_size_start) {
1071 *stmt_size = m_max_stmt_size - local_size_start;
1072 } else {
1073 *stmt_size = 0;
1074 }
1075
1076 /* POP m_max_stmt_size */
1077 m_max_stmt_size = stmt_size_start;
1078 }
1079
1080 void count_alloc(size_t size) {
1081 m_size += size;
1082 if (m_max_local_size < m_size) {
1084 }
1085 }
1086
1087 void count_free(size_t size) {
1088 if (m_size >= size) {
1089 m_size -= size;
1090 } else {
1091 /*
1092 Thread 1, allocates memory : owner = T1
1093 Thread 1 puts the memory in a global cache,
1094 but does not use unclaim.
1095 Thread 1 disconnects.
1096
1097 The memory in the cache has owner = T1,
1098 pointing to a defunct thread.
1099
1100 Thread 2 connects,
1101 Thread 2 purges the global cache,
1102 but does not use claim.
1103
1104 As a result, it appears that:
1105 - T1 'leaks' memory, even when there are no leaks.
1106 - T2 frees 'non existent' memory, even when it was allocated.
1107
1108 Long term fix is to enforce use of:
1109 - unclaim in T1
1110 - claim in T2,
1111 to make sure memory transfers are properly accounted for.
1112
1113 Short term fix, here, we discover (late) that:
1114 - the thread T2 uses more memory that was claimed
1115 (because it takes silently ownership of the global cache)
1116 - it releases more memory that it is supposed to own.
1117
1118 The net consumption of T2 is adjusted to 0,
1119 as it can not be negative.
1120 */
1121 m_size = 0;
1122 }
1123 }
1124
1125 size_t get_session_size() const { return m_size; }
1126
1127 size_t get_session_max() const {
1129 return m_max_local_size;
1130 }
1131 return m_max_session_size;
1132 }
1133};
1134
1138
1139 void reset();
1140
1144 }
1145
1146 void end_top_statement(size_t *controlled_size, size_t *total_size) {
1147 m_controlled.end_top_statement(controlled_size);
1148 m_total.end_top_statement(total_size);
1149 }
1150
1151 void start_nested_statement(size_t *controlled_local_size_start,
1152 size_t *controlled_stmt_size_start,
1153 size_t *total_local_size_start,
1154 size_t *total_stmt_size_start) {
1155 m_controlled.start_nested_statement(controlled_local_size_start,
1156 controlled_stmt_size_start);
1157 m_total.start_nested_statement(total_local_size_start,
1158 total_stmt_size_start);
1159 }
1160
1161 void end_nested_statement(size_t controlled_local_size_start,
1162 size_t controlled_stmt_size_start,
1163 size_t total_local_size_start,
1164 size_t total_stmt_size_start,
1165 size_t *controlled_size, size_t *total_size) {
1166 m_controlled.end_nested_statement(controlled_local_size_start,
1167 controlled_stmt_size_start,
1168 controlled_size);
1169 m_total.end_nested_statement(total_local_size_start, total_stmt_size_start,
1170 total_size);
1171 }
1172
1173 void count_controlled_alloc(size_t size);
1174 void count_uncontrolled_alloc(size_t size);
1175 void count_controlled_free(size_t size);
1176 void count_uncontrolled_free(size_t size);
1177};
1178
1181
1184
1187 PFS_memory_shared_stat *stat2);
1188
1191 PFS_memory_shared_stat *stat2);
1192
1193/**
1194 Aggregate thread memory statistics to the parent bucket.
1195 Also, reassign net memory contributed by this thread
1196 to the global bucket.
1197 This is necessary to balance globally allocations done by one
1198 thread with deallocations done by another thread.
1199*/
1202 PFS_memory_shared_stat *global);
1203
1207 PFS_memory_shared_stat *global);
1208
1211
1214
1217 PFS_memory_shared_stat *stat2);
1218
1221
1224
1225/** Connections statistics. */
1232
1237
1238 inline void aggregate_active(ulonglong active, ulonglong controlled_memory,
1239 ulonglong total_memory) {
1240 m_current_connections += active;
1241 m_total_connections += active;
1242
1243 if (m_max_session_controlled_memory < controlled_memory) {
1244 m_max_session_controlled_memory = controlled_memory;
1245 }
1246
1247 if (m_max_session_total_memory < total_memory) {
1248 m_max_session_total_memory = total_memory;
1249 }
1250 }
1251
1252 inline void aggregate_disconnected(ulonglong disconnected,
1253 ulonglong controlled_memory,
1254 ulonglong total_memory) {
1255 m_total_connections += disconnected;
1256
1257 if (m_max_session_controlled_memory < controlled_memory) {
1258 m_max_session_controlled_memory = controlled_memory;
1259 }
1260
1261 if (m_max_session_total_memory < total_memory) {
1262 m_max_session_total_memory = total_memory;
1263 }
1264 }
1265};
1266
1267/** @} */
1268#endif
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
#define MY_ZEROFILL
Definition: my_sys.h:138
void count_uncontrolled_alloc(size_t size)
Definition: pfs_stat.cc:407
void count_builtin_free(size_t size)
Definition: pfs_stat.cc:198
void normalize(bool global)
Definition: pfs_stat.cc:420
void memory_monitoring_aggregate(const PFS_memory_safe_stat *from, PFS_memory_monitoring_stat *stat)
Definition: pfs_stat.cc:975
PFS_memory_stat_alloc_delta * apply_alloc_delta(const PFS_memory_stat_alloc_delta *delta, PFS_memory_stat_alloc_delta *delta_buffer)
Definition: pfs_stat.cc:291
PFS_memory_stat_free_delta * count_free(size_t size, PFS_memory_stat_free_delta *delta)
Definition: pfs_stat.cc:258
void memory_partial_aggregate(PFS_memory_safe_stat *from, PFS_memory_shared_stat *stat)
Definition: pfs_stat.cc:451
void rebase()
Definition: pfs_stat.cc:49
PFS_TL_LOCK_TYPE
Definition: pfs_stat.h:688
void count_controlled_alloc(size_t size)
Definition: pfs_stat.cc:402
void count_controlled_free(size_t size)
Definition: pfs_stat.cc:411
PFS_memory_stat_alloc_delta * count_alloc(size_t size, PFS_memory_stat_alloc_delta *delta)
Definition: pfs_stat.cc:70
void memory_full_aggregate(const PFS_memory_safe_stat *from, PFS_memory_shared_stat *stat)
Definition: pfs_stat.cc:892
void reset()
Definition: pfs_stat.cc:397
PFS_memory_stat_free_delta * apply_free_delta(const PFS_memory_stat_free_delta *delta, PFS_memory_stat_free_delta *delta_buffer)
Definition: pfs_stat.cc:334
void reset()
Definition: pfs_stat.cc:35
void count_builtin_alloc(size_t size)
Definition: pfs_stat.cc:171
void rebase()
Definition: pfs_stat.cc:150
#define COUNT_PFS_TL_LOCK_TYPE
Definition: pfs_stat.h:706
void reset()
Definition: pfs_stat.cc:377
PFS_memory_stat_free_delta * count_free(size_t size, PFS_memory_stat_free_delta *delta)
Definition: pfs_stat.cc:103
void memory_full_aggregate_with_reassign(const PFS_memory_safe_stat *from, PFS_memory_shared_stat *stat, PFS_memory_shared_stat *global)
Aggregate thread memory statistics to the parent bucket.
Definition: pfs_stat.cc:683
void count_uncontrolled_free(size_t size)
Definition: pfs_stat.cc:416
PFS_memory_stat_alloc_delta * count_alloc(size_t size, PFS_memory_stat_alloc_delta *delta)
Definition: pfs_stat.cc:225
void reset()
Definition: pfs_stat.cc:136
@ PFS_TL_READ_EXTERNAL
Definition: pfs_stat.h:700
@ PFS_TL_READ_NO_INSERT
Definition: pfs_stat.h:693
@ PFS_TL_WRITE_LOW_PRIORITY
Definition: pfs_stat.h:696
@ PFS_TL_READ
Definition: pfs_stat.h:690
@ PFS_TL_WRITE_EXTERNAL
Definition: pfs_stat.h:701
@ PFS_TL_READ_HIGH_PRIORITY
Definition: pfs_stat.h:692
@ PFS_TL_WRITE_ALLOW_WRITE
Definition: pfs_stat.h:694
@ PFS_TL_WRITE
Definition: pfs_stat.h:697
@ PFS_TL_NONE
Definition: pfs_stat.h:703
@ PFS_TL_READ_WITH_SHARED_LOCKS
Definition: pfs_stat.h:691
@ PFS_TL_WRITE_CONCURRENT_INSERT
Definition: pfs_stat.h:695
@ PSI_ERROR_OPERATION_HANDLED
Definition: psi_error_bits.h:37
@ PSI_ERROR_OPERATION_RAISED
Definition: psi_error_bits.h:36
#define MAX_INDEXES
Definition: config.h:209
constexpr bool unlikely(bool expr)
Definition: my_compiler.h:57
unsigned long long int ulonglong
Definition: my_inttypes.h:55
#define MYF(v)
Definition: my_inttypes.h:96
Common header for many mysys elements.
Defines for getting and processing the current system type programmatically.
unsigned long long int my_micro_time()
Return time in microseconds.
Definition: my_systime.h:181
static int count
Definition: myisam_ftdump.cc:44
Type total(const Shards< COUNT > &shards) noexcept
Get the total value of all shards.
Definition: ut0counter.h:332
static int wait(mysql_cond_t *that, mysql_mutex_t *mutex, const char *, unsigned int)
Definition: mysql_cond_v1_native.cc:51
server error instrument data structures (declarations).
Miscellaneous global dependencies (declarations).
#define PFS_MALLOC_ARRAY(k, n, s, T, f)
Helper, to allocate an array of structures.
Definition: pfs_global.h:122
#define PFS_FREE_ARRAY(k, n, s, p)
Helper, to free an array of structures.
Definition: pfs_global.h:139
File containing constants that can be used throughout the server.
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:65
Definition: pfs_stat.h:1014
void count_alloc(size_t size)
Definition: pfs_stat.h:1080
size_t m_size
The current memory size allocated.
Definition: pfs_stat.h:1016
size_t m_max_stmt_size
The maximum memory size allocated, for a statement.
Definition: pfs_stat.h:1020
size_t m_max_local_size
The maximum memory size allocated, for a sub statement.
Definition: pfs_stat.h:1018
size_t m_max_session_size
The maximum memory size allocated, for this session.
Definition: pfs_stat.h:1022
void end_top_statement(size_t *stmt_size)
Definition: pfs_stat.h:1039
void count_free(size_t size)
Definition: pfs_stat.h:1087
size_t get_session_size() const
Definition: pfs_stat.h:1125
void end_nested_statement(size_t local_size_start, size_t stmt_size_start, size_t *stmt_size)
Definition: pfs_stat.h:1062
void start_nested_statement(size_t *local_size_start, size_t *stmt_size_start)
Definition: pfs_stat.h:1046
void start_top_statement()
Definition: pfs_stat.h:1031
void reset()
Definition: pfs_stat.h:1024
size_t get_session_max() const
Definition: pfs_stat.h:1127
Definition: pfs_builtin_memory.h:38
Combined statistic.
Definition: pfs_stat.h:129
void reset()
Definition: pfs_stat.h:169
PFS_byte_stat()
Definition: pfs_stat.h:167
ulonglong m_bytes
Byte count statistics.
Definition: pfs_stat.h:131
void aggregate_waits(const PFS_byte_stat *stat)
Aggregate wait stats and event count.
Definition: pfs_stat.h:154
void aggregate_no_check(const PFS_byte_stat *stat)
Aggregate wait stats, event count and byte count.
Definition: pfs_stat.h:142
void aggregate_counted(ulonglong bytes)
Aggregate event count and byte count.
Definition: pfs_stat.h:162
void aggregate_counted()
Aggregate event count and byte count.
Definition: pfs_stat.h:159
void aggregate(ulonglong wait, ulonglong bytes)
Aggregate individual wait time, event count and byte count.
Definition: pfs_stat.h:148
void aggregate(const PFS_byte_stat *stat)
Aggregate wait stats, event count and byte count.
Definition: pfs_stat.h:134
Statistics for conditions usage.
Definition: pfs_stat.h:237
void aggregate(const PFS_cond_stat *stat)
Definition: pfs_stat.h:253
PFS_single_stat m_wait_stat
Wait statistics.
Definition: pfs_stat.h:239
void reset()
Definition: pfs_stat.h:261
Connections statistics.
Definition: pfs_stat.h:1226
PFS_connection_stat()
Definition: pfs_stat.h:1227
void aggregate_active(ulonglong active, ulonglong controlled_memory, ulonglong total_memory)
Definition: pfs_stat.h:1238
ulonglong m_current_connections
Definition: pfs_stat.h:1233
ulonglong m_max_session_controlled_memory
Definition: pfs_stat.h:1235
ulonglong m_max_session_total_memory
Definition: pfs_stat.h:1236
void aggregate_disconnected(ulonglong disconnected, ulonglong controlled_memory, ulonglong total_memory)
Definition: pfs_stat.h:1252
ulonglong m_total_connections
Definition: pfs_stat.h:1234
Statistics for a server error.
Definition: pfs_stat.h:494
ulonglong m_last_seen
Definition: pfs_stat.h:499
void aggregate_count(int error_operation)
Definition: pfs_stat.h:517
ulonglong m_count
Definition: pfs_stat.h:495
PFS_error_single_stat()
Definition: pfs_stat.h:501
ulonglong m_handled_count
Definition: pfs_stat.h:496
ulonglong count() const
Definition: pfs_stat.h:508
ulonglong m_first_seen
First and last seen timestamps.
Definition: pfs_stat.h:498
void reset()
Definition: pfs_stat.h:510
void aggregate(const PFS_error_single_stat *stat)
Definition: pfs_stat.h:538
Statistics for all server errors.
Definition: pfs_stat.h:556
ulonglong count(uint error_index) const
Definition: pfs_stat.h:575
void aggregate(const PFS_error_stat *stat)
Definition: pfs_stat.h:630
const PFS_error_single_stat * get_stat(uint error_index) const
Definition: pfs_stat.h:563
ulonglong count() const
Definition: pfs_stat.h:567
void aggregate_count(int error_index, int error_operation)
Definition: pfs_stat.h:612
PFS_error_single_stat * m_stat
Definition: pfs_stat.h:559
PFS_error_stat()
Definition: pfs_stat.h:561
void init(PFS_builtin_memory_class *memory_class, size_t max_errors)
Definition: pfs_stat.h:579
void aggregate(const PFS_error_single_stat *stat, uint error_index)
Definition: pfs_stat.h:621
void reset()
Definition: pfs_stat.h:602
size_t m_max_errors
The number of errors, including +1 for the NULL row.
Definition: pfs_stat.h:558
void cleanup(PFS_builtin_memory_class *memory_class)
Definition: pfs_stat.h:592
Statistics for FILE I/O.
Definition: pfs_stat.h:271
void sum_waits(PFS_single_stat *stat)
Definition: pfs_stat.h:299
PFS_byte_stat m_read
READ statistics.
Definition: pfs_stat.h:273
void sum(PFS_byte_stat *stat)
Definition: pfs_stat.h:292
PFS_byte_stat m_write
WRITE statistics.
Definition: pfs_stat.h:275
void aggregate(const PFS_file_io_stat *stat)
Definition: pfs_stat.h:285
void reset()
Definition: pfs_stat.h:279
PFS_byte_stat m_misc
Miscellaneous statistics.
Definition: pfs_stat.h:277
Statistics for FILE usage.
Definition: pfs_stat.h:307
ulong m_open_count
Number of current open handles.
Definition: pfs_stat.h:309
void reset()
Reset file statistics.
Definition: pfs_stat.h:318
PFS_file_io_stat m_io_stat
File I/O statistics.
Definition: pfs_stat.h:311
void aggregate(const PFS_file_stat *stat)
Definition: pfs_stat.h:313
Definition: pfs_stat.h:990
size_t m_alloc_count
Definition: pfs_stat.h:991
size_t m_free_count_capacity
Definition: pfs_stat.h:997
size_t m_free_size
Definition: pfs_stat.h:994
size_t m_free_count
Definition: pfs_stat.h:992
size_t m_missing_free_size_capacity
Definition: pfs_stat.h:1002
ssize_t m_high_size_used
Definition: pfs_stat.h:1007
size_t m_alloc_count_capacity
Definition: pfs_stat.h:996
size_t m_alloc_size
Definition: pfs_stat.h:993
size_t m_missing_free_count_capacity
Definition: pfs_stat.h:1001
size_t m_alloc_size_capacity
Definition: pfs_stat.h:998
size_t m_free_size_capacity
Definition: pfs_stat.h:999
ssize_t m_low_count_used
Definition: pfs_stat.h:1004
ssize_t m_low_size_used
Definition: pfs_stat.h:1006
ssize_t m_high_count_used
Definition: pfs_stat.h:1005
Memory statistics.
Definition: pfs_stat.h:912
size_t m_free_count
Definition: pfs_stat.h:916
size_t m_free_size_capacity
Definition: pfs_stat.h:923
size_t m_alloc_count_capacity
Definition: pfs_stat.h:920
size_t m_alloc_size
Definition: pfs_stat.h:917
size_t m_free_count_capacity
Definition: pfs_stat.h:921
bool m_used
Definition: pfs_stat.h:913
size_t m_alloc_count
Definition: pfs_stat.h:915
size_t m_alloc_size_capacity
Definition: pfs_stat.h:922
size_t m_free_size
Definition: pfs_stat.h:918
Definition: pfs_stat.h:936
std::atomic< size_t > m_free_size_capacity
Definition: pfs_stat.h:947
std::atomic< size_t > m_free_count
Definition: pfs_stat.h:940
std::atomic< size_t > m_free_count_capacity
Definition: pfs_stat.h:945
std::atomic< size_t > m_free_size
Definition: pfs_stat.h:942
void count_global_free(size_t size)
Definition: pfs_stat.h:959
std::atomic< size_t > m_alloc_count_capacity
Definition: pfs_stat.h:944
void count_global_alloc(size_t size)
Definition: pfs_stat.h:957
std::atomic< size_t > m_alloc_size
Definition: pfs_stat.h:941
std::atomic< size_t > m_alloc_count
Definition: pfs_stat.h:939
std::atomic< bool > m_used
Definition: pfs_stat.h:937
std::atomic< size_t > m_alloc_size_capacity
Definition: pfs_stat.h:946
Definition: pfs_stat.h:882
size_t m_alloc_count_delta
Definition: pfs_stat.h:883
size_t m_alloc_size_delta
Definition: pfs_stat.h:884
Definition: pfs_stat.h:887
size_t m_free_size_delta
Definition: pfs_stat.h:889
size_t m_free_count_delta
Definition: pfs_stat.h:888
Statistics for mutex usage.
Definition: pfs_stat.h:176
PFS_single_stat m_wait_stat
Wait statistics.
Definition: pfs_stat.h:178
void aggregate(const PFS_mutex_stat *stat)
Definition: pfs_stat.h:187
void reset()
Definition: pfs_stat.h:194
Statistics for prepared statement usage.
Definition: pfs_stat.h:356
void reset()
Definition: pfs_stat.h:359
PFS_single_stat m_timer1_stat
Definition: pfs_stat.h:357
void aggregate_value(ulonglong value)
Definition: pfs_stat.h:363
void aggregate_counted()
Definition: pfs_stat.h:361
void aggregate(PFS_stage_stat *stat)
Definition: pfs_stat.h:367
Statistics for rwlock usage.
Definition: pfs_stat.h:203
void aggregate(const PFS_rwlock_stat *stat)
Definition: pfs_stat.h:219
void reset()
Definition: pfs_stat.h:227
PFS_single_stat m_wait_stat
Wait statistics.
Definition: pfs_stat.h:205
Definition: pfs_stat.h:1135
PFS_all_memory_stat m_total
Definition: pfs_stat.h:1137
void end_nested_statement(size_t controlled_local_size_start, size_t controlled_stmt_size_start, size_t total_local_size_start, size_t total_stmt_size_start, size_t *controlled_size, size_t *total_size)
Definition: pfs_stat.h:1161
void end_top_statement(size_t *controlled_size, size_t *total_size)
Definition: pfs_stat.h:1146
PFS_all_memory_stat m_controlled
Definition: pfs_stat.h:1136
void start_nested_statement(size_t *controlled_local_size_start, size_t *controlled_stmt_size_start, size_t *total_local_size_start, size_t *total_stmt_size_start)
Definition: pfs_stat.h:1151
void start_top_statement()
Definition: pfs_stat.h:1141
Single statistic.
Definition: pfs_stat.h:51
void aggregate_counted()
Definition: pfs_stat.h:101
void aggregate_value(ulonglong value)
Definition: pfs_stat.h:105
void aggregate(const PFS_single_stat *stat)
Definition: pfs_stat.h:77
void aggregate_many_value(ulonglong value, ulonglong count)
Definition: pfs_stat.h:116
PFS_single_stat()
Definition: pfs_stat.h:61
ulonglong m_count
Count of values.
Definition: pfs_stat.h:53
ulonglong m_max
Maximum value.
Definition: pfs_stat.h:59
void aggregate_counted(ulonglong count)
Definition: pfs_stat.h:103
void reset()
Definition: pfs_stat.h:68
ulonglong m_min
Minimum value.
Definition: pfs_stat.h:57
bool has_timed_stats() const
Definition: pfs_stat.h:75
void aggregate_no_check(const PFS_single_stat *stat)
Definition: pfs_stat.h:90
ulonglong m_sum
Sum of values.
Definition: pfs_stat.h:55
Statistics for SOCKET I/O.
Definition: pfs_stat.h:838
void sum(PFS_byte_stat *stat)
Definition: pfs_stat.h:859
void aggregate(const PFS_socket_io_stat *stat)
Definition: pfs_stat.h:852
void sum_waits(PFS_single_stat *stat)
Definition: pfs_stat.h:866
PFS_byte_stat m_read
READ statistics.
Definition: pfs_stat.h:840
PFS_byte_stat m_misc
Miscellaneous statistics.
Definition: pfs_stat.h:844
void reset()
Definition: pfs_stat.h:846
PFS_byte_stat m_write
WRITE statistics.
Definition: pfs_stat.h:842
Statistics for SOCKET usage.
Definition: pfs_stat.h:874
void reset()
Reset socket statistics.
Definition: pfs_stat.h:879
PFS_socket_io_stat m_io_stat
Socket timing and byte count statistics per operation.
Definition: pfs_stat.h:876
Statistics for stored program usage.
Definition: pfs_stat.h:339
void aggregate_value(ulonglong value)
Definition: pfs_stat.h:346
PFS_single_stat m_timer1_stat
Definition: pfs_stat.h:340
void reset()
Definition: pfs_stat.h:342
void aggregate(const PFS_stage_stat *stat)
Definition: pfs_stat.h:350
void aggregate_counted()
Definition: pfs_stat.h:344
Statistics for stage usage.
Definition: pfs_stat.h:322
void reset()
Definition: pfs_stat.h:325
void aggregate(const PFS_stage_stat *stat)
Definition: pfs_stat.h:333
PFS_single_stat m_timer1_stat
Definition: pfs_stat.h:323
void aggregate_value(ulonglong value)
Definition: pfs_stat.h:329
void aggregate_counted()
Definition: pfs_stat.h:327
Statistics for statement usage.
Definition: pfs_stat.h:375
ulonglong m_max_total_memory
Definition: pfs_stat.h:402
ulonglong m_sort_range
Definition: pfs_stat.h:391
void aggregate_value(ulonglong value)
Definition: pfs_stat.h:409
ulonglong m_select_range_check
Definition: pfs_stat.h:388
ulonglong m_select_scan
Definition: pfs_stat.h:389
ulonglong m_no_good_index_used
Definition: pfs_stat.h:395
ulonglong m_sort_rows
Definition: pfs_stat.h:392
ulonglong m_lock_time
Definition: pfs_stat.h:380
ulonglong m_created_tmp_disk_tables
Definition: pfs_stat.h:383
ulonglong m_max_controlled_memory
Definition: pfs_stat.h:401
ulonglong m_select_range
Definition: pfs_stat.h:387
void aggregate_counted()
Definition: pfs_stat.h:407
void reset()
Definition: pfs_stat.h:405
ulonglong m_cpu_time
CPU TIME.
Definition: pfs_stat.h:400
void aggregate_memory_size(size_t controlled_size, size_t total_size)
Definition: pfs_stat.h:413
ulonglong m_count_secondary
Definition: pfs_stat.h:403
ulonglong m_sort_scan
Definition: pfs_stat.h:393
ulonglong m_select_full_range_join
Definition: pfs_stat.h:386
ulonglong m_select_full_join
Definition: pfs_stat.h:385
ulonglong m_rows_examined
Definition: pfs_stat.h:382
ulonglong m_warning_count
Definition: pfs_stat.h:378
ulonglong m_rows_affected
Definition: pfs_stat.h:379
PFS_single_stat m_timer1_stat
Definition: pfs_stat.h:376
void aggregate(const PFS_statement_stat *stat)
Definition: pfs_stat.h:422
ulonglong m_created_tmp_tables
Definition: pfs_stat.h:384
ulonglong m_error_count
Definition: pfs_stat.h:377
ulonglong m_no_index_used
Definition: pfs_stat.h:394
ulonglong m_sort_merge_passes
Definition: pfs_stat.h:390
ulonglong m_rows_sent
Definition: pfs_stat.h:381
Single table I/O statistic.
Definition: pfs_stat.h:647
PFS_table_io_stat()
Definition: pfs_stat.h:658
void sum(PFS_single_stat *result)
Definition: pfs_stat.h:678
PFS_single_stat m_insert
INSERT statistics.
Definition: pfs_stat.h:652
bool m_has_data
Definition: pfs_stat.h:648
PFS_single_stat m_fetch
FETCH statistics.
Definition: pfs_stat.h:650
PFS_single_stat m_delete
DELETE statistics.
Definition: pfs_stat.h:656
PFS_single_stat m_update
UPDATE statistics.
Definition: pfs_stat.h:654
void reset()
Definition: pfs_stat.h:660
void aggregate(const PFS_table_io_stat *stat)
Definition: pfs_stat.h:668
Statistics for table locks.
Definition: pfs_stat.h:709
void sum(PFS_single_stat *result)
Definition: pfs_stat.h:729
void reset()
Definition: pfs_stat.h:712
void aggregate(const PFS_table_lock_stat *stat)
Definition: pfs_stat.h:720
PFS_single_stat m_stat[COUNT_PFS_TL_LOCK_TYPE]
Definition: pfs_stat.h:710
Statistics for TABLE usage.
Definition: pfs_stat.h:739
void aggregate_lock(const PFS_table_stat *stat)
Definition: pfs_stat.h:801
void aggregate_io(const PFS_table_stat *stat, uint key_count)
Definition: pfs_stat.h:780
void fast_reset_lock()
Definition: pfs_stat.h:774
PFS_table_lock_stat m_lock_stat
Statistics, per lock type.
Definition: pfs_stat.h:750
void fast_reset_io()
Definition: pfs_stat.h:770
void reset_io()
Reset table I/O statistic.
Definition: pfs_stat.h:753
void reset_lock()
Reset table lock statistic.
Definition: pfs_stat.h:762
PFS_table_io_stat m_index_stat[MAX_INDEXES+1]
Statistics, per index.
Definition: pfs_stat.h:745
void reset()
Reset table statistic.
Definition: pfs_stat.h:765
void fast_reset()
Definition: pfs_stat.h:778
static struct PFS_table_stat g_reset_template
Definition: pfs_stat.h:834
void sum(PFS_single_stat *result, uint key_count)
Definition: pfs_stat.h:829
void sum_io(PFS_single_stat *result, uint key_count)
Definition: pfs_stat.h:810
void aggregate(const PFS_table_stat *stat, uint key_count)
Definition: pfs_stat.h:805
void sum_lock(PFS_single_stat *result)
Definition: pfs_stat.h:827
Statistics for transaction usage.
Definition: pfs_stat.h:458
ulonglong m_release_savepoint_count
Definition: pfs_stat.h:464
ulonglong m_savepoint_count
Definition: pfs_stat.h:462
ulonglong count() const
Definition: pfs_stat.h:472
void reset()
Definition: pfs_stat.h:476
PFS_transaction_stat()
Definition: pfs_stat.h:466
PFS_single_stat m_read_write_stat
Definition: pfs_stat.h:459
PFS_single_stat m_read_only_stat
Definition: pfs_stat.h:460
ulonglong m_rollback_to_savepoint_count
Definition: pfs_stat.h:463
void aggregate(const PFS_transaction_stat *stat)
Definition: pfs_stat.h:484
Definition: result.h:29