~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/scoreboard.cc

  • Committer: Joseph Daly
  • Date: 2010-08-18 02:17:48 UTC
  • mto: (1725.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1726.
  • Revision ID: jdaly@rx7-20100818021748-f07775vmvq1o6vq9
add memory usage

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
{
61
61
 
62
62
  /* calculate the number of elements in each bucket */
63
 
  uint32_t number_per_bucket= static_cast<uint32_t> ( ceil( static_cast<double>(number_sessions) / static_cast<double>(number_buckets) ) );
 
63
  number_per_bucket= static_cast<uint32_t> ( ceil( static_cast<double>(number_sessions) / static_cast<double>(number_buckets) ) );
64
64
 
65
65
  /* populate the vector of scoreboard vectors */
66
66
  for (uint32_t j= 0; j < number_buckets; ++j)
95
95
      vector_of_scoreboard_locks.insert(vector_of_scoreboard_locks_iterator, lock);   
96
96
  } 
97
97
  vector_of_scoreboard_locks.resize(number_buckets);
 
98
 
 
99
  /* calculate the approximate memory allocation of the scoreboard */
 
100
  size_t statusVarsSize= sizeof(StatusVars) + sizeof(system_status_var);
 
101
  size_t userCommandsSize= sizeof(UserCommands) + sizeof(uint64_t) * SQLCOM_END;
 
102
 
 
103
  scoreboard_size_bytes= (statusVarsSize + userCommandsSize) * number_per_bucket * number_buckets;
98
104
}
99
105
 
100
106
Scoreboard::~Scoreboard()