~linuxjedi/drizzle/drizzle-bug-621603

« back to all changes in this revision

Viewing changes to plugin/logging_stats/scoreboard.cc

  • Committer: Monty Taylor
  • Date: 2010-08-21 08:44:38 UTC
  • mfrom: (1725.1.5 build)
  • Revision ID: mordred@inaugust.com-20100821084438-xco4t67quey63o0i
Visibility, suppressions and bugfixes.

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()