~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/user_commands.h

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#define PLUGIN_LOGGING_STATS_USER_COMMANDS_H
32
32
 
33
33
#include <drizzled/common.h>
34
 
 
 
34
#include <drizzled/enum.h>
35
35
#include <string>
 
36
#include <vector>
 
37
 
36
38
 
37
39
class UserCommands
38
40
{
40
42
 
41
43
  UserCommands();
42
44
 
43
 
  uint64_t getSelectCount();
44
 
 
45
 
  void incrementSelectCount(int i= 1);
46
 
 
47
 
 
48
 
  uint64_t getUpdateCount();
49
 
 
50
 
  void incrementUpdateCount(int i= 1);
51
 
 
52
 
 
53
 
  uint64_t getDeleteCount();
54
 
 
55
 
  void incrementDeleteCount(int i= 1);
56
 
 
57
 
 
58
 
  uint64_t getInsertCount();
59
 
 
60
 
  void incrementInsertCount(int i= 1);
61
 
 
62
 
 
63
 
  uint64_t getRollbackCount();
64
 
 
65
 
  void incrementRollbackCount(int i= 1);
66
 
 
67
 
 
68
 
  uint64_t getCommitCount();
69
 
 
70
 
  void incrementCommitCount(int i= 1);
71
 
 
72
 
 
73
 
  uint64_t getCreateCount();
74
 
 
75
 
  void incrementCreateCount(int i= 1);
76
 
 
77
 
 
78
 
  uint64_t getAlterCount();
79
 
 
80
 
  void incrementAlterCount(int i= 1);
81
 
 
82
 
 
83
 
  uint64_t getDropCount();
84
 
 
85
 
  void incrementDropCount(int i= 1);
86
 
 
87
 
 
88
 
  uint64_t getAdminCount();
89
 
 
90
 
  void incrementAdminCount(int i= 1);
 
45
  UserCommands(const UserCommands &user_commands);
 
46
 
 
47
  uint64_t getCount(uint32_t index);
 
48
 
 
49
  void merge(UserCommands *user_commands);
91
50
 
92
51
  void reset();
93
52
 
 
53
  void logCommand(drizzled::enum_sql_command sql_command);
 
54
 
 
55
  static uint32_t getStatusVarsCount()
 
56
  {
 
57
    return drizzled::SQLCOM_END;
 
58
  }
 
59
 
 
60
  static uint32_t getUserCounts()
 
61
  {
 
62
    return COUNT_END; 
 
63
  }
 
64
 
 
65
  static const char *COM_STATUS_VARS[];
 
66
 
 
67
  static const char *USER_COUNTS[];
 
68
 
 
69
  enum command_count_index {
 
70
    COUNT_SELECT,
 
71
    COUNT_DELETE,
 
72
    COUNT_UPDATE,
 
73
    COUNT_INSERT,
 
74
    COUNT_ROLLBACK,
 
75
    COUNT_COMMIT,
 
76
    COUNT_CREATE,
 
77
    COUNT_ALTER,
 
78
    COUNT_DROP,
 
79
    COUNT_ADMIN,
 
80
    /* add new COUNT_* values above this entry */
 
81
    COUNT_END 
 
82
  };
 
83
 
 
84
  uint64_t getUserCount(uint32_t index);
 
85
 
94
86
private:
95
 
  uint64_t update_count;
96
 
  uint64_t delete_count;
97
 
  uint64_t insert_count;
98
 
  uint64_t select_count;
99
 
  uint64_t rollback_count;
100
 
  uint64_t commit_count;
101
 
  uint64_t create_count;
102
 
  uint64_t alter_count;
103
 
  uint64_t drop_count;
104
 
  uint64_t admin_count;
 
87
  void init();
 
88
 
 
89
  void incrementCount(uint32_t index, uint32_t i= 1);
 
90
 
 
91
  std::vector<uint64_t> vector_of_command_counts;
105
92
};
106
93
 
107
94
#endif /* PLUGIN_LOGGING_STATS_USER_COMMANDS_H */