458
ScoreboardStatsTool::ScoreboardStatsTool(LoggingStats *logging_stats) :
459
plugin::TableFunction("DATA_DICTIONARY", "SCOREBOARD_STATISTICS")
461
outer_logging_stats= logging_stats;
463
add_field("SCOREBOARD_SIZE", TableFunction::NUMBER);
464
add_field("NUMBER_OF_RANGE_LOCKS", TableFunction::NUMBER);
465
add_field("MAX_USERS_LOGGED", TableFunction::NUMBER);
466
add_field("MEMORY_USAGE_BYTES", TableFunction::NUMBER);
469
ScoreboardStatsTool::Generator::Generator(Field **arg, LoggingStats *logging_stats) :
470
plugin::TableFunction::Generator(arg)
472
inner_logging_stats= logging_stats;
473
is_last_record= false;
476
bool ScoreboardStatsTool::Generator::populate()
483
Scoreboard *scoreboard= inner_logging_stats->getCurrentScoreboard();
484
CumulativeStats *cumulativeStats= inner_logging_stats->getCumulativeStats();
486
push(static_cast<uint64_t>(scoreboard->getNumberPerBucket() * scoreboard->getNumberBuckets()));
487
push(static_cast<uint64_t>(scoreboard->getNumberBuckets()));
488
push(static_cast<uint64_t>(cumulativeStats->getCumulativeStatsByUserMax()));
489
push(cumulativeStats->getCumulativeSizeBytes() + scoreboard->getScoreboardSizeBytes());
491
is_last_record= true;