~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statistics_variables.h

This patch completes the first step in the splitting of
the XA resource manager API from the storage engine API,
as outlined in the specification here:

http://drizzle.org/wiki/XaStorageEngine

* Splits plugin::StorageEngine into a base StorageEngine
  class and two derived classes, TransactionalStorageEngine
  and XaStorageEngine.  XaStorageEngine derives from
  TransactionalStorageEngine and creates the XA Resource
  Manager API for storage engines.

  - The methods moved from StorageEngine to TransactionalStorageEngine
    include releaseTemporaryLatches(), startConsistentSnapshot(), 
    commit(), rollback(), setSavepoint(), releaseSavepoint(),
    rollbackToSavepoint() and hasTwoPhaseCommit()
  - The methods moved from StorageEngine to XaStorageEngine
    include recover(), commitXid(), rollbackXid(), and prepare()

* Places all static "EngineVector"s into their proper
  namespaces (typedefs belong in header files, not implementation files)
  and places all static methods corresponding
  to either only transactional engines or only XA engines
  into their respective files in /drizzled/plugin/

* Modifies the InnoDB "handler" files to extend plugin::XaStorageEngine
  and not plugin::StorageEngine

The next step, as outlined in the wiki spec page above, is to isolate
the XA Resource Manager API into its own plugin class and modify
plugin::XaStorageEngine to implement plugin::XaResourceManager via
composition.  This is necessary to enable building plugins which can
participate in an XA transaction *without having to have that plugin
implement the entire storage engine API*

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
 
 *  Copyright (C) 2010 Joseph Daly 
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; version 2 of the License.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 */
20
 
 
21
 
#ifndef DRIZZLED_STATISTICS_VARIABLES_H
22
 
#define DRIZZLED_STATISTICS_VARIABLES_H
23
 
 
24
 
namespace drizzled
25
 
{
26
 
 
27
 
extern struct global_counters current_global_counters;
28
 
 
29
 
/* 
30
 
 * These statistics are global and are not per session
31
 
 * they are not reset once initialized. 
32
 
 */
33
 
typedef struct global_counters
34
 
{
35
 
  uint64_t max_used_connections;
36
 
  uint64_t connections;
37
 
  uint64_t locks_immediate;
38
 
  uint64_t locks_waited;
39
 
} global_counters;
40
 
 
41
 
/* 
42
 
 * These statistics are per session and are reset at the end
43
 
 * of each session, after being copied into a global 
44
 
 * system_status_var
45
 
 */
46
 
typedef struct system_status_var
47
 
{
48
 
  uint64_t aborted_connects;
49
 
  uint64_t aborted_threads;
50
 
  uint64_t access_denied;
51
 
  uint64_t bytes_received;
52
 
  uint64_t bytes_sent;
53
 
  uint64_t com_other;
54
 
  uint64_t created_tmp_disk_tables;
55
 
  uint64_t created_tmp_tables;
56
 
  uint64_t ha_commit_count;
57
 
  uint64_t ha_delete_count;
58
 
  uint64_t ha_read_first_count;
59
 
  uint64_t ha_read_last_count;
60
 
  uint64_t ha_read_key_count;
61
 
  uint64_t ha_read_next_count;
62
 
  uint64_t ha_read_prev_count;
63
 
  uint64_t ha_read_rnd_count;
64
 
  uint64_t ha_read_rnd_next_count;
65
 
  uint64_t ha_rollback_count;
66
 
  uint64_t ha_update_count;
67
 
  uint64_t ha_write_count;
68
 
  uint64_t ha_prepare_count;
69
 
  uint64_t ha_savepoint_count;
70
 
  uint64_t ha_savepoint_rollback_count;
71
 
 
72
 
  uint64_t select_full_join_count;
73
 
  uint64_t select_full_range_join_count;
74
 
  uint64_t select_range_count;
75
 
  uint64_t select_range_check_count;
76
 
  uint64_t select_scan_count;
77
 
  uint64_t long_query_count;
78
 
  uint64_t filesort_merge_passes;
79
 
  uint64_t filesort_range_count;
80
 
  uint64_t filesort_rows;
81
 
  uint64_t filesort_scan_count;
82
 
  uint64_t connection_time;
83
 
  uint64_t execution_time_nsec;
84
 
  uint64_t updated_row_count;
85
 
  uint64_t deleted_row_count;
86
 
  uint64_t inserted_row_count;
87
 
  /*
88
 
    Number of statements sent from the client
89
 
  */
90
 
  uint64_t questions;
91
 
  /*
92
 
    IMPORTANT!
93
 
    SEE last_system_status_var DEFINITION BELOW.
94
 
 
95
 
    Below 'last_system_status_var' are all variables which doesn't make any
96
 
    sense to add to the /global/ status variable counter.
97
 
  */
98
 
  double last_query_cost;
99
 
} system_status_var;
100
 
 
101
 
#define last_system_status_var questions
102
 
 
103
 
} /* namespace drizzled */
104
 
 
105
 
#endif /* DRIZZLED_STATISTICS_VARIABLES_H */