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