338
StatusVarTool::StatusVarTool(LoggingStats *logging_stats) :
339
plugin::TableFunction("DATA_DICTIONARY", "CUMULATIVE_USER_STATS")
341
outer_logging_stats= logging_stats;
344
add_field("BYTES_RECEIVED", TableFunction::NUMBER);
345
add_field("BYTES_SENT", TableFunction::NUMBER);
348
StatusVarTool::Generator::Generator(Field **arg, LoggingStats *logging_stats) :
349
plugin::TableFunction::Generator(arg)
351
inner_logging_stats= logging_stats;
354
if (inner_logging_stats->isEnabled())
356
last_valid_index= inner_logging_stats->getCumulativeStats()->getCumulativeStatsLastValidIndex();
360
last_valid_index= INVALID_INDEX;
364
bool StatusVarTool::Generator::populate()
366
if ((record_number > last_valid_index) || (last_valid_index == INVALID_INDEX))
371
while (record_number <= last_valid_index)
373
ScoreboardSlot *cumulative_scoreboard_slot=
374
inner_logging_stats->getCumulativeStats()->getCumulativeStatsByUserVector()->at(record_number);
376
if (cumulative_scoreboard_slot->isInUse())
378
StatusVars *status_vars= cumulative_scoreboard_slot->getStatusVars();
379
push(cumulative_scoreboard_slot->getUser());
380
push(status_vars->getStatusVarCounters()->bytes_received);
381
push(status_vars->getStatusVarCounters()->bytes_sent);