~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/haildb/status_table_function.cc

  • Committer: Stewart Smith
  • Date: 2010-10-06 08:13:42 UTC
  • mto: This revision was merged to the branch mainline in revision 1842.
  • Revision ID: stewart@flamingspork.com-20101006081342-f7crr8rctbrsklui
change HailDB status table function to use ib_status_get_all() API call - new to HailDB 2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
  class Generator : public drizzled::plugin::TableFunction::Generator
42
42
  {
43
43
  private:
 
44
    const char **names;
 
45
    uint32_t names_count;
44
46
    uint32_t names_next;
45
47
  public:
46
48
    Generator(drizzled::Field **arg);
55
57
  }
56
58
};
57
59
 
58
 
static const char*      libinnodb_status_var_names[] = {
59
 
  "read_req_pending",
60
 
  "write_req_pending",
61
 
  "fsync_req_pending",
62
 
  "write_req_done",
63
 
  "read_req_done",
64
 
  "fsync_req_done",
65
 
  "bytes_total_written",
66
 
  "bytes_total_read",
67
 
 
68
 
  "buffer_pool_current_size",
69
 
  "buffer_pool_data_pages",
70
 
  "buffer_pool_dirty_pages",
71
 
  "buffer_pool_misc_pages",
72
 
  "buffer_pool_free_pages",
73
 
  "buffer_pool_read_reqs",
74
 
  "buffer_pool_reads",
75
 
  "buffer_pool_waited_for_free",
76
 
  "buffer_pool_pages_flushed",
77
 
  "buffer_pool_write_reqs",
78
 
  "buffer_pool_total_pages",
79
 
  "buffer_pool_pages_read",
80
 
  "buffer_pool_pages_written",
81
 
 
82
 
  "double_write_pages_written",
83
 
  "double_write_invoked",
84
 
 
85
 
  "log_buffer_slot_waits",
86
 
  "log_write_reqs",
87
 
  "log_write_flush_count",
88
 
  "log_bytes_written",
89
 
  "log_fsync_req_done",
90
 
  "log_write_req_pending",
91
 
  "log_fsync_req_pending",
92
 
 
93
 
  "lock_row_waits",
94
 
  "lock_row_waiting",
95
 
  "lock_total_wait_time_in_secs",
96
 
  "lock_wait_time_avg_in_secs",
97
 
  "lock_max_wait_time_in_secs",
98
 
 
99
 
  "row_total_read",
100
 
  "row_total_inserted",
101
 
  "row_total_updated",
102
 
  "row_total_deleted",
103
 
 
104
 
  "page_size",
105
 
  "have_atomic_builtins",
106
 
  NULL
107
 
};
108
 
 
109
60
LibInnoDBStatusTool::LibInnoDBStatusTool() :
110
61
  plugin::TableFunction("DATA_DICTIONARY", "HAILDB_STATUS")
111
62
{
117
68
  plugin::TableFunction::Generator(arg),
118
69
  names_next(0)
119
70
{
 
71
  ib_err_t err= ib_status_get_all(&names, &names_count);
 
72
  assert(err == DB_SUCCESS);
120
73
}
121
74
 
122
75
LibInnoDBStatusTool::Generator::~Generator()
123
76
{
 
77
  free(names);
124
78
}
125
79
 
126
80
bool LibInnoDBStatusTool::Generator::populate()
127
81
{
128
 
  if (libinnodb_status_var_names[names_next] != NULL)
 
82
  if (names[names_next] != NULL)
129
83
  {
130
 
    const char* config_name= libinnodb_status_var_names[names_next];
 
84
    const char* config_name= names[names_next];
131
85
 
132
86
    push(config_name);
133
87