~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/logging_stats.cc

doc modifications

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
84
84
 * 
85
85
 */
86
86
 
87
 
#include <config.h>
 
87
#include "config.h"
88
88
#include "user_commands.h"
89
89
#include "status_vars.h"
90
90
#include "global_stats.h"
128
128
void LoggingStats::updateCurrentScoreboard(ScoreboardSlot *scoreboard_slot,
129
129
                                           Session *session)
130
130
{
131
 
  enum_sql_command sql_command= session->getLex()->sql_command;
 
131
  enum_sql_command sql_command= session->lex->sql_command;
132
132
 
133
133
  scoreboard_slot->getUserCommands()->logCommand(sql_command);
134
134
 
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;