~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/cumulative_stats.cc

  • Committer: Mark Atwood
  • Date: 2011-09-14 03:30:42 UTC
  • mfrom: (2409.2.6 refactor7)
  • Revision ID: me@mark.atwood.name-20110914033042-2u0s8foaigvf62g2
mergeĀ lp:~olafvdspek/drizzle/refactor7

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
  global_status_vars->merge(scoreboard_slot->getStatusVars());
137
137
}
138
138
 
139
 
int32_t CumulativeStats::getCumulativeStatsLastValidIndex()
 
139
int32_t CumulativeStats::getCumulativeStatsLastValidIndex() const
140
140
{
141
 
  if (last_valid_index < cumulative_stats_by_user_max)
142
 
  {
143
 
    return last_valid_index;
144
 
  } 
145
 
  else 
146
 
  {
147
 
    return cumulative_stats_by_user_max;
148
 
  }
 
141
  return last_valid_index < cumulative_stats_by_user_max ? last_valid_index : cumulative_stats_by_user_max;
149
142
}
150
143
 
151
 
void CumulativeStats::sumCurrentScoreboard(Scoreboard *scoreboard,
152
 
                                           StatusVars *current_status_vars,
153
 
                                           UserCommands *current_user_commands)
 
144
void CumulativeStats::sumCurrentScoreboard(Scoreboard *scoreboard, StatusVars *current_status_vars, UserCommands *current_user_commands)
154
145
{
155
146
  /* the vector of vectors */
156
 
  vector<vector<ScoreboardSlot* >* > *vector_of_scoreboard_vectors= 
157
 
    scoreboard->getVectorOfScoreboardVectors();
 
147
  vector<vector<ScoreboardSlot* >* > *vector_of_scoreboard_vectors= scoreboard->getVectorOfScoreboardVectors();
158
148
 
159
149
  /* iterate through each vector from above and sum each ScoreboardSlot */
160
150
 
161
151
  vector<vector<ScoreboardSlot* >* >::iterator v_of_scoreboard_v_begin_it= vector_of_scoreboard_vectors->begin(); 
162
 
 
163
152
  vector<vector<ScoreboardSlot* >* >::iterator v_of_scoreboard_v_end_it= vector_of_scoreboard_vectors->end(); 
164
153
 
165
154
  for (; v_of_scoreboard_v_begin_it != v_of_scoreboard_v_end_it; ++v_of_scoreboard_v_begin_it)