MySQL 8.0.31
Source Code Documentation
pfs_stat.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2022, 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(void) {
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(void) {
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(void) {
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(void) {
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(void) {
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(void) {
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(void) { m_io_stat.reset(); }
319};
320
321/** Statistics for stage usage. */
324
325 inline void reset(void) { 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(void) { 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(void) { 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
474 }
475
476 inline void reset(void) {
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(void) { 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
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) { return m_stat[error_index].count(); }
576
577 inline void init(PFS_builtin_memory_class *memory_class, size_t max_errors) {
578 if (max_errors == 0) {
579 return;
580 }
581
582 m_max_errors = max_errors;
583 /* Allocate memory for errors' stats. The NULL row is already included. */
584 m_stat = PFS_MALLOC_ARRAY(memory_class, m_max_errors,
585 sizeof(PFS_error_single_stat),
587 reset();
588 }
589
590 inline void cleanup(PFS_builtin_memory_class *memory_class) {
591 if (m_stat == nullptr) {
592 return;
593 }
594
596 m_stat);
597 m_stat = nullptr;
598 }
599
600 inline void reset() {
601 if (m_stat == nullptr) {
602 return;
603 }
604
605 for (uint i = 0; i < m_max_errors; i++) {
606 m_stat[i].reset();
607 }
608 }
609
610 inline void aggregate_count(int error_index, int error_operation) {
611 if (m_stat == nullptr) {
612 return;
613 }
614
615 PFS_error_single_stat *stat = &m_stat[error_index];
616 stat->aggregate_count(error_operation);
617 }
618
619 inline void aggregate(const PFS_error_single_stat *stat, uint error_index) {
620 if (m_stat == nullptr) {
621 return;
622 }
623
624 assert(error_index < m_max_errors);
625 m_stat[error_index].aggregate(stat);
626 }
627
628 inline void aggregate(const PFS_error_stat *stat) {
629 if (m_stat == nullptr) {
630 return;
631 }
632
633 /*
634 Sizes can be different, for example when aggregating
635 per session statistics into global statistics.
636 */
637 size_t common_max = std::min(m_max_errors, stat->m_max_errors);
638 for (uint i = 0; i < common_max; i++) {
639 m_stat[i].aggregate(&stat->m_stat[i]);
640 }
641 }
642};
643
644/** Single table I/O statistic. */
647 /** FETCH statistics */
649 /** INSERT statistics */
651 /** UPDATE statistics */
653 /** DELETE statistics */
655
657
658 inline void reset(void) {
659 m_has_data = false;
660 m_fetch.reset();
661 m_insert.reset();
662 m_update.reset();
663 m_delete.reset();
664 }
665
666 inline void aggregate(const PFS_table_io_stat *stat) {
667 if (stat->m_has_data) {
668 m_has_data = true;
669 m_fetch.aggregate(&stat->m_fetch);
673 }
674 }
675
676 inline void sum(PFS_single_stat *result) {
677 if (m_has_data) {
678 result->aggregate(&m_fetch);
679 result->aggregate(&m_insert);
680 result->aggregate(&m_update);
681 result->aggregate(&m_delete);
682 }
683 }
684};
685
687 /* Locks from enum thr_lock */
696
697 /* Locks for handler::ha_external_lock() */
700
701 PFS_TL_NONE = 99
703
704#define COUNT_PFS_TL_LOCK_TYPE 10
705
706/** Statistics for table locks. */
709
710 inline void reset(void) {
713 for (; pfs < pfs_last; pfs++) {
714 pfs->reset();
715 }
716 }
717
718 inline void aggregate(const PFS_table_lock_stat *stat) {
721 const PFS_single_stat *pfs_from = &stat->m_stat[0];
722 for (; pfs < pfs_last; pfs++, pfs_from++) {
723 pfs->aggregate(pfs_from);
724 }
725 }
726
727 inline void sum(PFS_single_stat *result) {
730 for (; pfs < pfs_last; pfs++) {
731 result->aggregate(pfs);
732 }
733 }
734};
735
736/** Statistics for TABLE usage. */
738 /**
739 Statistics, per index.
740 Each index stat is in [0, MAX_INDEXES-1],
741 stats when using no index are in [MAX_INDEXES].
742 */
744
745 /**
746 Statistics, per lock type.
747 */
749
750 /** Reset table I/O statistic. */
751 inline void reset_io(void) {
753 PFS_table_io_stat *stat_last = &m_index_stat[MAX_INDEXES + 1];
754 for (; stat < stat_last; stat++) {
755 stat->reset();
756 }
757 }
758
759 /** Reset table lock statistic. */
760 inline void reset_lock(void) { m_lock_stat.reset(); }
761
762 /** Reset table statistic. */
763 inline void reset(void) {
764 reset_io();
765 reset_lock();
766 }
767
768 inline void fast_reset_io(void) {
770 }
771
772 inline void fast_reset_lock(void) {
774 }
775
776 inline void fast_reset(void) {
777 memcpy(this, &g_reset_template, sizeof(*this));
778 }
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(void) {
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(void) { 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(void);
926
927 void rebase(void);
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(void);
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:135
void count_uncontrolled_alloc(size_t size)
Definition: pfs_stat.cc:411
void count_builtin_free(size_t size)
Definition: pfs_stat.cc:200
void normalize(bool global)
Definition: pfs_stat.cc:424
void memory_monitoring_aggregate(const PFS_memory_safe_stat *from, PFS_memory_monitoring_stat *stat)
Definition: pfs_stat.cc:979
void rebase(void)
Definition: pfs_stat.cc:49
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:295
PFS_memory_stat_free_delta * count_free(size_t size, PFS_memory_stat_free_delta *delta)
Definition: pfs_stat.cc:262
void reset(void)
Definition: pfs_stat.cc:381
void memory_partial_aggregate(PFS_memory_safe_stat *from, PFS_memory_shared_stat *stat)
Definition: pfs_stat.cc:455
PFS_TL_LOCK_TYPE
Definition: pfs_stat.h:686
void count_controlled_alloc(size_t size)
Definition: pfs_stat.cc:406
void count_controlled_free(size_t size)
Definition: pfs_stat.cc:415
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:896
void reset()
Definition: pfs_stat.cc:401
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:338
void count_builtin_alloc(size_t size)
Definition: pfs_stat.cc:171
void reset(void)
Definition: pfs_stat.cc:35
void rebase()
Definition: pfs_stat.cc:150
#define COUNT_PFS_TL_LOCK_TYPE
Definition: pfs_stat.h:704
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:687
void count_uncontrolled_free(size_t size)
Definition: pfs_stat.cc:420
PFS_memory_stat_alloc_delta * count_alloc(size_t size, PFS_memory_stat_alloc_delta *delta)
Definition: pfs_stat.cc:229
void reset()
Definition: pfs_stat.cc:136
@ PFS_TL_READ_EXTERNAL
Definition: pfs_stat.h:698
@ PFS_TL_READ_NO_INSERT
Definition: pfs_stat.h:691
@ PFS_TL_WRITE_LOW_PRIORITY
Definition: pfs_stat.h:694
@ PFS_TL_READ
Definition: pfs_stat.h:688
@ PFS_TL_WRITE_EXTERNAL
Definition: pfs_stat.h:699
@ PFS_TL_READ_HIGH_PRIORITY
Definition: pfs_stat.h:690
@ PFS_TL_WRITE_ALLOW_WRITE
Definition: pfs_stat.h:692
@ PFS_TL_WRITE
Definition: pfs_stat.h:695
@ PFS_TL_NONE
Definition: pfs_stat.h:701
@ PFS_TL_READ_WITH_SHARED_LOCKS
Definition: pfs_stat.h:689
@ PFS_TL_WRITE_CONCURRENT_INSERT
Definition: pfs_stat.h:693
@ 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:210
constexpr bool unlikely(bool expr)
Definition: my_compiler.h:55
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:42
Type total(const Shards< COUNT > &shards) noexcept
Get the total value of all shards.
Definition: ut0counter.h:332
stdx::expected< size_t, std::error_code > wait(int epfd, epoll_event *fd_events, size_t num_fd_events, std::chrono::milliseconds timeout)
Definition: linux_epoll.h:82
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:120
#define PFS_FREE_ARRAY(k, n, s, p)
Helper, to free an array of structures.
Definition: pfs_global.h:137
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
PFS_byte_stat()
Definition: pfs_stat.h:167
void reset(void)
Definition: pfs_stat.h:169
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
void reset(void)
Definition: pfs_stat.h:261
PFS_single_stat m_wait_stat
Wait statistics.
Definition: pfs_stat.h:239
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(void)
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
void aggregate(const PFS_error_stat *stat)
Definition: pfs_stat.h:628
const PFS_error_single_stat * get_stat(uint error_index) const
Definition: pfs_stat.h:563
ulonglong count(void)
Definition: pfs_stat.h:567
ulonglong count(uint error_index)
Definition: pfs_stat.h:575
void aggregate_count(int error_index, int error_operation)
Definition: pfs_stat.h:610
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:577
void aggregate(const PFS_error_single_stat *stat, uint error_index)
Definition: pfs_stat.h:619
void reset()
Definition: pfs_stat.h:600
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:590
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
PFS_byte_stat m_misc
Miscellaneous statistics.
Definition: pfs_stat.h:277
void reset(void)
Definition: pfs_stat.h:279
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(void)
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 reset(void)
Definition: pfs_stat.h:194
void aggregate(const PFS_mutex_stat *stat)
Definition: pfs_stat.h:187
Statistics for prepared statement usage.
Definition: pfs_stat.h:356
void reset(void)
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
PFS_single_stat m_wait_stat
Wait statistics.
Definition: pfs_stat.h:205
void reset(void)
Definition: pfs_stat.h:227
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
ulonglong m_min
Minimum value.
Definition: pfs_stat.h:57
void reset(void)
Definition: pfs_stat.h:68
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
PFS_byte_stat m_write
WRITE statistics.
Definition: pfs_stat.h:842
void reset(void)
Definition: pfs_stat.h:846
Statistics for SOCKET usage.
Definition: pfs_stat.h:874
PFS_socket_io_stat m_io_stat
Socket timing and byte count statistics per operation.
Definition: pfs_stat.h:876
void reset(void)
Reset socket statistics.
Definition: pfs_stat.h:879
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(void)
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 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 reset(void)
Definition: pfs_stat.h:325
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:645
PFS_table_io_stat()
Definition: pfs_stat.h:656
void sum(PFS_single_stat *result)
Definition: pfs_stat.h:676
PFS_single_stat m_insert
INSERT statistics.
Definition: pfs_stat.h:650
bool m_has_data
Definition: pfs_stat.h:646
PFS_single_stat m_fetch
FETCH statistics.
Definition: pfs_stat.h:648
PFS_single_stat m_delete
DELETE statistics.
Definition: pfs_stat.h:654
PFS_single_stat m_update
UPDATE statistics.
Definition: pfs_stat.h:652
void reset(void)
Definition: pfs_stat.h:658
void aggregate(const PFS_table_io_stat *stat)
Definition: pfs_stat.h:666
Statistics for table locks.
Definition: pfs_stat.h:707
void sum(PFS_single_stat *result)
Definition: pfs_stat.h:727
void aggregate(const PFS_table_lock_stat *stat)
Definition: pfs_stat.h:718
PFS_single_stat m_stat[COUNT_PFS_TL_LOCK_TYPE]
Definition: pfs_stat.h:708
void reset(void)
Definition: pfs_stat.h:710
Statistics for TABLE usage.
Definition: pfs_stat.h:737
void reset_lock(void)
Reset table lock statistic.
Definition: pfs_stat.h:760
void aggregate_lock(const PFS_table_stat *stat)
Definition: pfs_stat.h:801
void reset(void)
Reset table statistic.
Definition: pfs_stat.h:763
void fast_reset_io(void)
Definition: pfs_stat.h:768
void aggregate_io(const PFS_table_stat *stat, uint key_count)
Definition: pfs_stat.h:780
PFS_table_lock_stat m_lock_stat
Statistics, per lock type.
Definition: pfs_stat.h:748
PFS_table_io_stat m_index_stat[MAX_INDEXES+1]
Statistics, per index.
Definition: pfs_stat.h:743
void reset_io(void)
Reset table I/O statistic.
Definition: pfs_stat.h:751
void fast_reset_lock(void)
Definition: pfs_stat.h:772
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
void fast_reset(void)
Definition: pfs_stat.h:776
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(void)
Definition: pfs_stat.h:472
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
void reset(void)
Definition: pfs_stat.h:476
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
unsigned int uint
Definition: uca-dump.cc:29