~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/stats_schema.h

  • Committer: Brian Aker
  • Date: 2010-06-02 17:48:07 UTC
  • mto: (1578.6.10 explain-drizzle)
  • mto: This revision was merged to the branch mainline in revision 1589.
  • Revision ID: brian@gir-2.local-20100602174807-9unmrwp18ewkwol5
Modify merge-buffer to use std::vector in one location (just curious to see
if this shows up on benchmarks).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2010 Joseph Daly <skinny.moey@gmail.com>
 
2
 * Copyright (c) 2010, Joseph Daly <skinny.moey@gmail.com>
3
3
 * All rights reserved.
4
4
 *
5
5
 * Redistribution and use in source and binary forms, with or without
33
33
#include <drizzled/plugin/table_function.h>
34
34
#include <drizzled/field.h>
35
35
 
36
 
#include "user_commands.h"
 
36
#include "logging_stats.h"
37
37
#include "global_stats.h"
38
 
#include "logging_stats.h"
39
38
 
40
39
#include <vector>
41
40
 
49
48
  public:
50
49
    Generator(drizzled::Field **arg, LoggingStats *logging_stats);
51
50
 
52
 
    ~Generator();
53
 
 
54
51
    bool populate();
55
52
 
56
53
  private:
57
 
    GlobalStats *global_stats_to_display; 
 
54
    GlobalStats *global_stats; 
58
55
    uint32_t count;
59
56
  };
60
57
 
114
111
    std::vector<ScoreboardSlot *>::iterator scoreboard_vector_end;
115
112
    std::vector<std::vector<ScoreboardSlot* >* >::iterator vector_of_scoreboard_vectors_it;
116
113
    std::vector<std::vector<ScoreboardSlot* >* >::iterator vector_of_scoreboard_vectors_end; 
117
 
    boost::shared_mutex* current_lock;
 
114
    pthread_rwlock_t* current_lock;
118
115
 
119
116
    void setVectorIteratorsAndLock(uint32_t bucket_number);
120
117
  };
153
150
  LoggingStats *outer_logging_stats;
154
151
};
155
152
 
156
 
class CumulativeUserStatsTool : public drizzled::plugin::TableFunction
157
 
{
158
 
public:
159
 
 
160
 
  CumulativeUserStatsTool(LoggingStats *logging_stats);
161
 
 
162
 
  class Generator : public drizzled::plugin::TableFunction::Generator
163
 
  {
164
 
  public:
165
 
    Generator(drizzled::Field **arg, LoggingStats *logging_stats);
166
 
 
167
 
    bool populate();
168
 
  private:
169
 
    LoggingStats *inner_logging_stats;
170
 
    int32_t record_number;
171
 
    int32_t last_valid_index;
172
 
  };
173
 
 
174
 
  Generator *generator(drizzled::Field **arg)
175
 
  {
176
 
    return new Generator(arg, outer_logging_stats);
177
 
  }
178
 
private:
179
 
  LoggingStats *outer_logging_stats;
180
 
};
181
 
 
182
 
class ScoreboardStatsTool : public drizzled::plugin::TableFunction
183
 
{
184
 
public:
185
 
 
186
 
  ScoreboardStatsTool(LoggingStats *logging_stats);
187
 
 
188
 
  class Generator : public drizzled::plugin::TableFunction::Generator
189
 
  {
190
 
  public:
191
 
    Generator(drizzled::Field **arg, LoggingStats *logging_stats);
192
 
 
193
 
    bool populate();
194
 
  private:
195
 
    LoggingStats *inner_logging_stats;
196
 
    bool is_last_record;
197
 
  };
198
 
 
199
 
  Generator *generator(drizzled::Field **arg)
200
 
  {
201
 
    return new Generator(arg, outer_logging_stats);
202
 
  }
203
 
private:
204
 
  LoggingStats *outer_logging_stats;
205
 
};
206
 
 
207
153
#endif /* PLUGIN_LOGGING_STATS_STATS_SCHEMA_H */