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 #ifndef CLIENT_STATS_H
00023 #define CLIENT_STATS_H
00024 
00025 #include "client_priv.h"
00026 #include <string>
00027 #include <iostream>
00028 
00029 class Stats 
00030 {
00031 public:
00032   Stats(long int in_timing,
00033         uint32_t in_users,
00034         uint32_t in_real_users,
00035         uint32_t in_rows,
00036         long int in_create_timing,
00037         uint64_t in_create_count) :
00038     timing(in_timing),
00039     users(in_users),
00040     real_users(in_real_users),
00041     rows(in_rows),
00042     create_timing(in_create_timing),
00043     create_count(in_create_count)
00044   { }
00045 
00046   Stats() :
00047     timing(0),
00048     users(0),
00049     real_users(0),
00050     rows(0),
00051     create_timing(0),
00052     create_count(0)
00053   { }
00054 
00055   long int getTiming() const
00056   {
00057     return timing;
00058   }
00059 
00060   uint32_t getUsers() const
00061   {
00062     return users;
00063   }   
00064 
00065   uint32_t getRealUsers() const
00066   {
00067     return real_users;
00068   }
00069 
00070   uint64_t getRows() const
00071   {
00072     return rows;
00073   }
00074 
00075   long int getCreateTiming() const
00076   {
00077     return create_timing;
00078   }
00079 
00080   uint64_t getCreateCount() const
00081   {
00082     return create_count;
00083   }
00084 
00085   void setTiming(long int in_timing)
00086   {
00087   timing= in_timing;
00088   }
00089 
00090   void setUsers(uint32_t in_users)
00091   {
00092     users= in_users;
00093   }
00094 
00095   void setRealUsers(uint32_t in_real_users)
00096   {
00097     real_users= in_real_users;
00098   }
00099 
00100   void setRows(uint64_t in_rows)
00101   {
00102     rows= in_rows;
00103   }
00104    
00105   void setCreateTiming(long int in_create_timing)
00106   {
00107     create_timing= in_create_timing;
00108   }
00109 
00110   void setCreateCount(uint64_t in_create_count)
00111   {
00112   create_count= in_create_count;
00113   }
00114   
00115 private:
00116   long int timing;
00117   uint32_t users;
00118   uint32_t real_users;
00119   uint64_t rows;
00120   long int create_timing;
00121   uint64_t create_count;
00122 };
00123 
00124 #endif /* CLIENT_STATS_H */