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 
00026 extern struct global_counters current_global_counters;
00027 
00028 /* 
00029  * These statistics are global and are not per session
00030  * they are not reset once initialized. 
00031  */
00032 typedef struct global_counters
00033 {
00034   uint64_t max_used_connections;
00035   uint64_t connections;
00036   uint64_t locks_immediate;
00037   uint64_t locks_waited;
00038 } global_counters;
00039 
00040 /* 
00041  * These statistics are per session and are reset at the end
00042  * of each session, after being copied into a global 
00043  * system_status_var
00044  */
00045 typedef struct system_status_var
00046 {
00047   uint64_t aborted_connects;
00048   uint64_t aborted_threads;
00049   uint64_t access_denied;
00050   uint64_t bytes_received;
00051   uint64_t bytes_sent;
00052   uint64_t com_other;
00053   uint64_t created_tmp_disk_tables;
00054   uint64_t created_tmp_tables;
00055   uint64_t ha_commit_count;
00056   uint64_t ha_delete_count;
00057   uint64_t ha_read_first_count;
00058   uint64_t ha_read_last_count;
00059   uint64_t ha_read_key_count;
00060   uint64_t ha_read_next_count;
00061   uint64_t ha_read_prev_count;
00062   uint64_t ha_read_rnd_count;
00063   uint64_t ha_read_rnd_next_count;
00064   uint64_t ha_rollback_count;
00065   uint64_t ha_update_count;
00066   uint64_t ha_write_count;
00067   uint64_t ha_prepare_count;
00068   uint64_t ha_savepoint_count;
00069   uint64_t ha_savepoint_rollback_count;
00070 
00071   uint64_t select_full_join_count;
00072   uint64_t select_full_range_join_count;
00073   uint64_t select_range_count;
00074   uint64_t select_range_check_count;
00075   uint64_t select_scan_count;
00076   uint64_t long_query_count;
00077   uint64_t filesort_merge_passes;
00078   uint64_t filesort_range_count;
00079   uint64_t filesort_rows;
00080   uint64_t filesort_scan_count;
00081   uint64_t connection_time;
00082   uint64_t execution_time_nsec;
00083   uint64_t updated_row_count;
00084   uint64_t deleted_row_count;
00085   uint64_t inserted_row_count;
00086   /*
00087     Number of statements sent from the client
00088   */
00089   uint64_t questions;
00090   /*
00091     IMPORTANT!
00092     SEE last_system_status_var DEFINITION BELOW.
00093 
00094     Below 'last_system_status_var' are all variables which doesn't make any
00095     sense to add to the /global/ status variable counter.
00096   */
00097   double last_query_cost;
00098 } system_status_var;
00099 
00100 #define last_system_status_var questions
00101 
00102 } /* namespace drizzled */
00103