Drizzled Public API Documentation

stats.h
00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2010 Vijay Samuel
00005  *  Copyright (C) 2008 MySQL
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #pragma once
00023 
00024 #include "client_priv.h"
00025 #include <string>
00026 #include <iosfwd>
00027 
00028 class Stats 
00029 {
00030 public:
00031   Stats(long int in_timing,
00032         uint32_t in_users,
00033         uint32_t in_real_users,
00034         uint32_t in_rows,
00035         long int in_create_timing,
00036         uint64_t in_create_count) :
00037     timing(in_timing),
00038     users(in_users),
00039     real_users(in_real_users),
00040     rows(in_rows),
00041     create_timing(in_create_timing),
00042     create_count(in_create_count)
00043   { }
00044 
00045   Stats() :
00046     timing(0),
00047     users(0),
00048     real_users(0),
00049     rows(0),
00050     create_timing(0),
00051     create_count(0)
00052   { }
00053 
00054   long int getTiming() const
00055   {
00056     return timing;
00057   }
00058 
00059   uint32_t getUsers() const
00060   {
00061     return users;
00062   }   
00063 
00064   uint32_t getRealUsers() const
00065   {
00066     return real_users;
00067   }
00068 
00069   uint64_t getRows() const
00070   {
00071     return rows;
00072   }
00073 
00074   long int getCreateTiming() const
00075   {
00076     return create_timing;
00077   }
00078 
00079   uint64_t getCreateCount() const
00080   {
00081     return create_count;
00082   }
00083 
00084   void setTiming(long int in_timing)
00085   {
00086   timing= in_timing;
00087   }
00088 
00089   void setUsers(uint32_t in_users)
00090   {
00091     users= in_users;
00092   }
00093 
00094   void setRealUsers(uint32_t in_real_users)
00095   {
00096     real_users= in_real_users;
00097   }
00098 
00099   void setRows(uint64_t in_rows)
00100   {
00101     rows= in_rows;
00102   }
00103    
00104   void setCreateTiming(long int in_create_timing)
00105   {
00106     create_timing= in_create_timing;
00107   }
00108 
00109   void setCreateCount(uint64_t in_create_count)
00110   {
00111   create_count= in_create_count;
00112   }
00113   
00114 private:
00115   long int timing;
00116   uint32_t users;
00117   uint32_t real_users;
00118   uint64_t rows;
00119   long int create_timing;
00120   uint64_t create_count;
00121 };