1
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
17
#include "my_global.h"
18
#include "my_pthread.h"
19
#include "pfs_con_slice.h"
21
#include "pfs_global.h"
22
#include "pfs_instr_class.h"
25
@file storage/perfschema/pfs_con_slice.cc
26
Performance schema connection slice (implementation).
30
@addtogroup Performance_schema_buffers
35
PFS_connection_slice::alloc_waits_slice(uint sizing)
37
PFS_single_stat *slice= NULL;
42
slice= PFS_MALLOC_ARRAY(sizing, PFS_single_stat, MYF(MY_ZEROFILL));
43
if (unlikely(slice == NULL))
46
for (index= 0; index < sizing; index++)
54
PFS_connection_slice::alloc_stages_slice(uint sizing)
56
PFS_stage_stat *slice= NULL;
61
slice= PFS_MALLOC_ARRAY(sizing, PFS_stage_stat, MYF(MY_ZEROFILL));
62
if (unlikely(slice == NULL))
65
for (index= 0; index < sizing; index++)
73
PFS_connection_slice::alloc_statements_slice(uint sizing)
75
PFS_statement_stat *slice= NULL;
80
slice= PFS_MALLOC_ARRAY(sizing, PFS_statement_stat, MYF(MY_ZEROFILL));
81
if (unlikely(slice == NULL))
84
for (index= 0; index < sizing; index++)
91
void PFS_connection_slice::reset_waits_stats()
93
PFS_single_stat *stat= m_instr_class_waits_stats;
94
PFS_single_stat *stat_last= stat + wait_class_max;
95
for ( ; stat < stat_last; stat++)
99
void PFS_connection_slice::reset_stages_stats()
101
PFS_stage_stat *stat= m_instr_class_stages_stats;
102
PFS_stage_stat *stat_last= stat + stage_class_max;
103
for ( ; stat < stat_last; stat++)
107
void PFS_connection_slice::reset_statements_stats()
109
PFS_statement_stat *stat= m_instr_class_statements_stats;
110
PFS_statement_stat *stat_last= stat + statement_class_max;
111
for ( ; stat < stat_last; stat++)