Drizzled Public API Documentation

statistics_variables.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008 Sun Microsystems, Inc.
00005  *  Copyright (C) 2010 Joseph Daly 
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; version 2 of the License.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 #pragma once
00022 
00023 namespace drizzled {
00024 
00025 extern struct global_counters current_global_counters;
00026 
00027 /* 
00028  * These statistics are global and are not per session
00029  * they are not reset once initialized. 
00030  */
00031 typedef struct global_counters
00032 {
00033   uint64_t max_used_connections;
00034   uint64_t connections;
00035   uint64_t locks_immediate;
00036   uint64_t locks_waited;
00037 } global_counters;
00038 
00039 /* 
00040  * These statistics are per session and are reset at the end
00041  * of each session, after being copied into a global 
00042  * system_status_var
00043  */
00044 typedef struct system_status_var
00045 {
00046   uint64_t aborted_connects;
00047   uint64_t aborted_threads;
00048   uint64_t access_denied;
00049   uint64_t bytes_received;
00050   uint64_t bytes_sent;
00051   uint64_t com_other;
00052   uint64_t created_tmp_disk_tables;
00053   uint64_t created_tmp_tables;
00054   uint64_t ha_commit_count;
00055   uint64_t ha_delete_count;
00056   uint64_t ha_read_first_count;
00057   uint64_t ha_read_last_count;
00058   uint64_t ha_read_key_count;
00059   uint64_t ha_read_next_count;
00060   uint64_t ha_read_prev_count;
00061   uint64_t ha_read_rnd_count;
00062   uint64_t ha_read_rnd_next_count;
00063   uint64_t ha_rollback_count;
00064   uint64_t ha_update_count;
00065   uint64_t ha_write_count;
00066   uint64_t ha_prepare_count;
00067   uint64_t ha_savepoint_count;
00068   uint64_t ha_savepoint_rollback_count;
00069 
00070   uint64_t select_full_join_count;
00071   uint64_t select_full_range_join_count;
00072   uint64_t select_range_count;
00073   uint64_t select_range_check_count;
00074   uint64_t select_scan_count;
00075   uint64_t long_query_count;
00076   uint64_t filesort_merge_passes;
00077   uint64_t filesort_range_count;
00078   uint64_t filesort_rows;
00079   uint64_t filesort_scan_count;
00080   uint64_t connection_time;
00081   uint64_t execution_time_nsec;
00082   uint64_t updated_row_count;
00083   uint64_t deleted_row_count;
00084   uint64_t inserted_row_count;
00085   /*
00086     Number of statements sent from the client
00087   */
00088   uint64_t questions;
00089   /*
00090     IMPORTANT!
00091     SEE last_system_status_var DEFINITION BELOW.
00092 
00093     Below 'last_system_status_var' are all variables which doesn't make any
00094     sense to add to the /global/ status variable counter.
00095   */
00096   double last_query_cost;
00097 } system_status_var;
00098 
00099 #define last_system_status_var questions
00100 
00101 } /* namespace drizzled */
00102