~drizzle-trunk/drizzle/development

1848.5.1 by Vijay Samuel
Merge pushed classes of drizzleslap out into separate classes.
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2010 Vijay Samuel
1848.5.2 by Vijay Samuel
Merge corrections to licensing information.
5
 *  Copyright (C) 2008 MySQL
1848.5.1 by Vijay Samuel
Merge pushed classes of drizzleslap out into separate classes.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  (at your option) any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program; if not, write to the Free Software
19
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
 */
21
1848.5.4 by Vijay Samuel
Merge added #ifndef tags
22
#ifndef CLIENT_STATS_H
23
#define CLIENT_STATS_H
24
1848.5.1 by Vijay Samuel
Merge pushed classes of drizzleslap out into separate classes.
25
#include "client_priv.h"
26
#include <string>
27
#include <iostream>
28
29
class Stats 
30
{
31
public:
32
  Stats(long int in_timing,
33
        uint32_t in_users,
34
        uint32_t in_real_users,
35
        uint32_t in_rows,
36
        long int in_create_timing,
37
        uint64_t in_create_count) :
38
    timing(in_timing),
39
    users(in_users),
40
    real_users(in_real_users),
41
    rows(in_rows),
42
    create_timing(in_create_timing),
43
    create_count(in_create_count)
44
  { }
45
46
  Stats() :
47
    timing(0),
48
    users(0),
49
    real_users(0),
50
    rows(0),
51
    create_timing(0),
52
    create_count(0)
53
  { }
54
55
  long int getTiming() const
56
  {
57
    return timing;
58
  }
59
60
  uint32_t getUsers() const
61
  {
62
    return users;
63
  }   
64
65
  uint32_t getRealUsers() const
66
  {
67
    return real_users;
68
  }
69
70
  uint64_t getRows() const
71
  {
72
    return rows;
73
  }
74
75
  long int getCreateTiming() const
76
  {
77
    return create_timing;
78
  }
79
80
  uint64_t getCreateCount() const
81
  {
82
    return create_count;
83
  }
84
85
  void setTiming(long int in_timing)
86
  {
87
  timing= in_timing;
88
  }
89
90
  void setUsers(uint32_t in_users)
91
  {
92
    users= in_users;
93
  }
94
95
  void setRealUsers(uint32_t in_real_users)
96
  {
97
    real_users= in_real_users;
98
  }
99
100
  void setRows(uint64_t in_rows)
101
  {
102
    rows= in_rows;
103
  }
104
   
105
  void setCreateTiming(long int in_create_timing)
106
  {
107
    create_timing= in_create_timing;
108
  }
109
110
  void setCreateCount(uint64_t in_create_count)
111
  {
112
  create_count= in_create_count;
113
  }
114
  
115
private:
116
  long int timing;
117
  uint32_t users;
118
  uint32_t real_users;
119
  uint64_t rows;
120
  long int create_timing;
121
  uint64_t create_count;
122
};
1848.5.4 by Vijay Samuel
Merge added #ifndef tags
123
124
#endif /* CLIENT_STATS_H */