~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/haildb/status_table_function.cc

  • Committer: lbieber
  • Date: 2010-10-02 19:48:35 UTC
  • mfrom: (1730.6.19 drizzle-make-lcov)
  • Revision ID: lbieber@orisndriz08-20101002194835-q5zd9qc4lvx1xnfo
Merge Hartmut - clean up lex, now require flex to build, also "make lcov" improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "config.h"
20
20
#include "drizzled/plugin/table_function.h"
21
21
 
22
 
#include <haildb.h>
 
22
#if defined(HAVE_HAILDB_H)
 
23
# include <haildb.h>
 
24
#else
 
25
# include <embedded_innodb-1.0/innodb.h>
 
26
#endif /* HAVE_HAILDB_H */
23
27
 
24
28
#include "status_table_function.h"
25
29
 
41
45
  class Generator : public drizzled::plugin::TableFunction::Generator
42
46
  {
43
47
  private:
44
 
    const char **names;
45
 
    uint32_t names_count;
46
48
    uint32_t names_next;
47
49
  public:
48
50
    Generator(drizzled::Field **arg);
57
59
  }
58
60
};
59
61
 
 
62
static const char*      libinnodb_status_var_names[] = {
 
63
  "read_req_pending",
 
64
  "write_req_pending",
 
65
  "fsync_req_pending",
 
66
  "write_req_done",
 
67
  "read_req_done",
 
68
  "fsync_req_done",
 
69
  "bytes_total_written",
 
70
  "bytes_total_read",
 
71
 
 
72
  "buffer_pool_current_size",
 
73
  "buffer_pool_data_pages",
 
74
  "buffer_pool_dirty_pages",
 
75
  "buffer_pool_misc_pages",
 
76
  "buffer_pool_free_pages",
 
77
  "buffer_pool_read_reqs",
 
78
  "buffer_pool_reads",
 
79
  "buffer_pool_waited_for_free",
 
80
  "buffer_pool_pages_flushed",
 
81
  "buffer_pool_write_reqs",
 
82
  "buffer_pool_total_pages",
 
83
  "buffer_pool_pages_read",
 
84
  "buffer_pool_pages_written",
 
85
 
 
86
  "double_write_pages_written",
 
87
  "double_write_invoked",
 
88
 
 
89
  "log_buffer_slot_waits",
 
90
  "log_write_reqs",
 
91
  "log_write_flush_count",
 
92
  "log_bytes_written",
 
93
  "log_fsync_req_done",
 
94
  "log_write_req_pending",
 
95
  "log_fsync_req_pending",
 
96
 
 
97
  "lock_row_waits",
 
98
  "lock_row_waiting",
 
99
  "lock_total_wait_time_in_secs",
 
100
  "lock_wait_time_avg_in_secs",
 
101
  "lock_max_wait_time_in_secs",
 
102
 
 
103
  "row_total_read",
 
104
  "row_total_inserted",
 
105
  "row_total_updated",
 
106
  "row_total_deleted",
 
107
 
 
108
  "page_size",
 
109
  "have_atomic_builtins",
 
110
  NULL
 
111
};
 
112
 
60
113
LibInnoDBStatusTool::LibInnoDBStatusTool() :
61
114
  plugin::TableFunction("DATA_DICTIONARY", "HAILDB_STATUS")
62
115
{
68
121
  plugin::TableFunction::Generator(arg),
69
122
  names_next(0)
70
123
{
71
 
  ib_err_t err= ib_status_get_all(&names, &names_count);
72
 
  assert(err == DB_SUCCESS);
73
124
}
74
125
 
75
126
LibInnoDBStatusTool::Generator::~Generator()
76
127
{
77
 
  free(names);
78
128
}
79
129
 
80
130
bool LibInnoDBStatusTool::Generator::populate()
81
131
{
82
 
  if (names[names_next] != NULL)
 
132
  if (libinnodb_status_var_names[names_next] != NULL)
83
133
  {
84
 
    const char* config_name= names[names_next];
 
134
    const char* config_name= libinnodb_status_var_names[names_next];
85
135
 
86
136
    push(config_name);
87
137