~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/logging_stats.h

  • Committer: Paul McCullagh
  • Date: 2010-05-03 10:42:41 UTC
  • mfrom: (1515 staging)
  • mto: (1516.1.1 staging)
  • mto: This revision was merged to the branch mainline in revision 1517.
  • Revision ID: paul.mccullagh@primebase.org-20100503104241-8a6vadl1lx7m27zm
Merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#define PLUGIN_LOGGING_STATS_LOGGING_STATS_H
32
32
 
33
33
#include "scoreboard_slot.h"
 
34
#include "cumulative_stats.h"
34
35
#include "user_commands.h"
35
36
#include "scoreboard.h"
 
37
 
36
38
#include <drizzled/atomics.h>
37
39
#include <drizzled/enum.h>
38
40
#include <drizzled/session.h>
41
43
#include <string>
42
44
#include <vector>
43
45
 
44
 
extern pthread_rwlock_t LOCK_current_scoreboard_vector;
45
 
 
46
46
class LoggingStats: public drizzled::plugin::Logging
47
47
{
48
48
public:
75
75
    return current_scoreboard;
76
76
  }
77
77
 
78
 
  std::vector<ScoreboardSlot* > *getCumulativeStatsByUserVector()
79
 
  {
80
 
    return cumulative_stats_by_user_vector; 
81
 
  }
82
 
 
83
 
  uint32_t getCumulativeStatsByUserIndex()
84
 
  {
85
 
    return cumulative_stats_by_user_index;
 
78
  CumulativeStats *getCumulativeStats()
 
79
  {
 
80
    return cumulative_stats;
86
81
  }
87
82
 
88
83
private:
89
84
  static const int32_t UNINITIALIZED= -1;
90
85
 
91
 
  std::vector<ScoreboardSlot* > *cumulative_stats_by_user_vector;
92
 
 
93
 
  uint32_t cumulative_stats_by_user_max;
94
 
 
95
 
  uint32_t cumulative_stats_by_user_index;
96
 
 
97
86
  Scoreboard *current_scoreboard;
98
87
 
99
 
  bool isBeingLogged(drizzled::Session *session);
 
88
  CumulativeStats *cumulative_stats;
 
89
 
 
90
  drizzled::atomic<bool> is_enabled;
100
91
 
101
92
  void updateCurrentScoreboard(ScoreboardSlot *scoreboard_slot, drizzled::Session *session);
102
 
 
103
 
  void updateCumulativeStatsByUserVector(ScoreboardSlot *current_scoreboard_slot);
104
 
 
105
 
  void preAllocateScoreboardSlotVector(uint32_t size,
106
 
                                       std::vector<ScoreboardSlot *> *scoreboard_slot_vector);
107
 
 
108
 
  void deleteScoreboardSlotVector(std::vector<ScoreboardSlot *> *scoreboard_slot_vector);
109
 
 
110
 
  drizzled::atomic<bool> is_enabled;
111
 
 
112
93
};
113
94
#endif /* PLUGIN_LOGGING_STATS_LOGGING_STATS_H */