~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/cumulative_stats.cc

  • Committer: Joe Daly
  • Date: 2010-06-25 03:22:55 UTC
  • mto: This revision was merged to the branch mainline in revision 1656.
  • Revision ID: skinny.moey@gmail.com-20100625032255-bzj84xre67qldfpi
initial user stats impl

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
  delete global_status_vars;
66
66
}
67
67
 
68
 
void CumulativeStats::logUserStats(ScoreboardSlot *scoreboard_slot)
 
68
void CumulativeStats::logUserStats(ScoreboardSlot *scoreboard_slot, bool reserveSlot)
69
69
{
70
70
  vector<ScoreboardSlot *>::iterator cumulative_it= cumulative_stats_by_user_vector->begin();
71
 
  bool found= false;
72
71
 
73
72
  /* Search if this is a pre-existing user */
74
73
 
85
84
    string user= cumulative_scoreboard_slot->getUser();
86
85
    if (user.compare(scoreboard_slot->getUser()) == 0)
87
86
    {
88
 
      found= true;
 
87
      reserveSlot= false;
89
88
      cumulative_scoreboard_slot->merge(scoreboard_slot);
90
89
      break;
91
90
    }
92
91
    ++cumulative_it;
93
92
  }
94
 
 
95
 
  if (! found)
 
93
  
 
94
  if (reserveSlot)
96
95
  {
97
96
    /* the user was not found */
98
97
    /* its possible multiple simultaneous connections with the same user