~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/user_commands.cc

  • Committer: Eric Day
  • Date: 2010-03-25 19:28:37 UTC
  • mfrom: (1405 staging)
  • mto: This revision was merged to the branch mainline in revision 1409.
  • Revision ID: eday@oddments.org-20100325192837-4exmacbrywjovsqp
Merged trunk, rsolved conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2010, Joseph Daly <skinny.moey@gmail.com>
 
3
 * All rights reserved.
 
4
 *
 
5
 * Redistribution and use in source and binary forms, with or without
 
6
 * modification, are permitted provided that the following conditions are met:
 
7
 *
 
8
 *   * Redistributions of source code must retain the above copyright notice,
 
9
 *     this list of conditions and the following disclaimer.
 
10
 *   * Redistributions in binary form must reproduce the above copyright notice,
 
11
 *     this list of conditions and the following disclaimer in the documentation
 
12
 *     and/or other materials provided with the distribution.
 
13
 *   * Neither the name of Joseph Daly nor the names of its contributors
 
14
 *     may be used to endorse or promote products derived from this software
 
15
 *     without specific prior written permission.
 
16
 *
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 
18
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
20
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 
21
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
22
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
23
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
24
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
25
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
26
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 
27
 * THE POSSIBILITY OF SUCH DAMAGE.
 
28
 */
 
29
 
 
30
#include "user_commands.h"
 
31
 
 
32
UserCommands::UserCommands()
 
33
    :
 
34
      update_count(0),
 
35
      delete_count(0),
 
36
      insert_count(0),
 
37
      select_count(0),
 
38
      rollback_count(0),
 
39
      commit_count(0),
 
40
      create_count(0),
 
41
      alter_count(0),
 
42
      drop_count(0),
 
43
      admin_count(0)
 
44
{}
 
45
 
 
46
void UserCommands::reset()
 
47
{
 
48
  update_count= 0;
 
49
  delete_count= 0;
 
50
  insert_count= 0;
 
51
  select_count= 0;
 
52
  rollback_count= 0;
 
53
  commit_count= 0;
 
54
  create_count= 0;
 
55
  alter_count= 0;
 
56
  drop_count= 0;
 
57
  admin_count= 0;
 
58
}
 
59
 
 
60
uint64_t UserCommands::getSelectCount()
 
61
{
 
62
  return select_count;
 
63
}
 
64
 
 
65
void UserCommands::incrementSelectCount(int i)
 
66
{
 
67
  select_count= select_count + i;
 
68
}
 
69
 
 
70
uint64_t UserCommands::getUpdateCount()
 
71
{
 
72
  return update_count;
 
73
}
 
74
 
 
75
void UserCommands::incrementUpdateCount(int i)
 
76
{
 
77
  update_count= update_count + i;
 
78
}
 
79
 
 
80
uint64_t UserCommands::getDeleteCount()
 
81
{
 
82
  return delete_count;
 
83
}
 
84
 
 
85
void UserCommands::incrementDeleteCount(int i)
 
86
{
 
87
  delete_count= delete_count + i;
 
88
}
 
89
 
 
90
uint64_t UserCommands::getInsertCount()
 
91
{
 
92
  return insert_count;
 
93
}
 
94
 
 
95
void UserCommands::incrementInsertCount(int i)
 
96
{
 
97
  insert_count= insert_count + i;
 
98
}
 
99
 
 
100
uint64_t UserCommands::getRollbackCount()
 
101
{
 
102
  return rollback_count;
 
103
}
 
104
 
 
105
void UserCommands::incrementRollbackCount(int i)
 
106
{
 
107
  rollback_count= rollback_count + i;
 
108
}
 
109
 
 
110
uint64_t UserCommands::getCommitCount()
 
111
{
 
112
  return commit_count;
 
113
}
 
114
 
 
115
void UserCommands::incrementCommitCount(int i)
 
116
{
 
117
  commit_count= commit_count + i;
 
118
}
 
119
 
 
120
uint64_t UserCommands::getCreateCount()
 
121
{
 
122
  return create_count;
 
123
}
 
124
 
 
125
void UserCommands::incrementCreateCount(int i)
 
126
{
 
127
  create_count= create_count + i;
 
128
}
 
129
 
 
130
uint64_t UserCommands::getAlterCount()
 
131
{
 
132
  return alter_count;
 
133
}
 
134
 
 
135
void UserCommands::incrementAlterCount(int i)
 
136
{
 
137
  alter_count= alter_count + i;
 
138
}
 
139
 
 
140
uint64_t UserCommands::getDropCount()
 
141
{
 
142
  return drop_count;
 
143
}
 
144
 
 
145
void UserCommands::incrementDropCount(int i)
 
146
{
 
147
  drop_count= drop_count + i;
 
148
}
 
149
 
 
150
uint64_t UserCommands::getAdminCount()
 
151
{
 
152
  return admin_count;
 
153
}
 
154
 
 
155
void UserCommands::incrementAdminCount(int i)
 
156
{
 
157
  admin_count= admin_count + i;
 
158
}