~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/logging_stats.cc

  • Committer: Patrick Crews
  • Date: 2010-12-07 20:02:50 UTC
  • Revision ID: gleebix@gmail.com-20101207200250-6a27jgqalgw5bsb5
Added disabled.def file to disable drizzleslap due to Bug#684269.  Need to skip for tarball release this round

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
210
210
       the scoreboard would be filled up quickly with invalid users. 
211
211
    */
212
212
    scoreboard_slot= new ScoreboardSlot();
213
 
    scoreboard_slot->setUser(session->user()->username());
214
 
    scoreboard_slot->setIp(session->user()->address());
 
213
    scoreboard_slot->setUser(session->getSecurityContext().getUser());
 
214
    scoreboard_slot->setIp(session->getSecurityContext().getIp());
215
215
  }
216
216
 
217
217
  scoreboard_slot->getStatusVars()->logStatusVar(session);
218
 
  scoreboard_slot->getStatusVars()->getStatusVarCounters()->connection_time= session->getConnectSeconds(); 
 
218
  scoreboard_slot->getStatusVars()->getStatusVarCounters()->connection_time= time(NULL) - session->start_time; 
219
219
 
220
220
  cumulative_stats->logUserStats(scoreboard_slot, isInScoreboard);
221
221
  cumulative_stats->logGlobalStats(scoreboard_slot);
370
370
{
371
371
  context("max-user-count",
372
372
          po::value<max_user_count_constraint>(&sysvar_logging_stats_max_user_count)->default_value(500),
373
 
          _("Max number of users that will be logged"));
 
373
          N_("Max number of users that will be logged"));
374
374
  context("bucket-count",
375
375
          po::value<bucket_count_constraint>(&sysvar_logging_stats_bucket_count)->default_value(10),
376
 
          _("Max number of range locks to use for Scoreboard"));
 
376
          N_("Max number of range locks to use for Scoreboard"));
377
377
  context("scoreboard-size",
378
378
          po::value<scoreboard_size_constraint>(&sysvar_logging_stats_scoreboard_size)->default_value(2000),
379
 
          _("Max number of concurrent sessions that will be logged"));
380
 
  context("disable", _("Enable Logging Statistics Collection"));
 
379
          N_("Max number of concurrent sessions that will be logged"));
 
380
  context("disable", N_("Enable Logging Statistics Collection"));
381
381
}
382
382
 
383
383
DRIZZLE_DECLARE_PLUGIN
389
389
  N_("User Statistics as DATA_DICTIONARY tables"),
390
390
  PLUGIN_LICENSE_BSD,
391
391
  init,   /* Plugin Init      */
392
 
  NULL, /* depends */
 
392
  NULL, /* system variables */
393
393
  init_options    /* config options   */
394
394
}
395
395
DRIZZLE_DECLARE_PLUGIN_END;