~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
2371.1.1 by Brian Aker
Fedora fix/use fwd header for iostream.
22
#pragma once
1848.5.4 by Vijay Samuel
Merge added #ifndef tags
23
1848.5.1 by Vijay Samuel
Merge pushed classes of drizzleslap out into separate classes.
24
#include "client_priv.h"
25
#include <string>
2371.1.1 by Brian Aker
Fedora fix/use fwd header for iostream.
26
#include <iosfwd>
1848.5.1 by Vijay Samuel
Merge pushed classes of drizzleslap out into separate classes.
27
28
class Stats 
29
{
30
public:
31
  Stats(long int in_timing,
32
        uint32_t in_users,
33
        uint32_t in_real_users,
34
        uint32_t in_rows,
35
        long int in_create_timing,
36
        uint64_t in_create_count) :
37
    timing(in_timing),
38
    users(in_users),
39
    real_users(in_real_users),
40
    rows(in_rows),
41
    create_timing(in_create_timing),
42
    create_count(in_create_count)
43
  { }
44
45
  Stats() :
46
    timing(0),
47
    users(0),
48
    real_users(0),
49
    rows(0),
50
    create_timing(0),
51
    create_count(0)
52
  { }
53
54
  long int getTiming() const
55
  {
56
    return timing;
57
  }
58
59
  uint32_t getUsers() const
60
  {
61
    return users;
62
  }   
63
64
  uint32_t getRealUsers() const
65
  {
66
    return real_users;
67
  }
68
69
  uint64_t getRows() const
70
  {
71
    return rows;
72
  }
73
74
  long int getCreateTiming() const
75
  {
76
    return create_timing;
77
  }
78
79
  uint64_t getCreateCount() const
80
  {
81
    return create_count;
82
  }
83
84
  void setTiming(long int in_timing)
85
  {
86
  timing= in_timing;
87
  }
88
89
  void setUsers(uint32_t in_users)
90
  {
91
    users= in_users;
92
  }
93
94
  void setRealUsers(uint32_t in_real_users)
95
  {
96
    real_users= in_real_users;
97
  }
98
99
  void setRows(uint64_t in_rows)
100
  {
101
    rows= in_rows;
102
  }
103
   
104
  void setCreateTiming(long int in_create_timing)
105
  {
106
    create_timing= in_create_timing;
107
  }
108
109
  void setCreateCount(uint64_t in_create_count)
110
  {
111
  create_count= in_create_count;
112
  }
113
  
114
private:
115
  long int timing;
116
  uint32_t users;
117
  uint32_t real_users;
118
  uint64_t rows;
119
  long int create_timing;
120
  uint64_t create_count;
121
};