6 namespace account_statistics {
21 my = std::make_shared<detail::account_statistics_api_impl>(ctx.
app);
30 return my->_app.chain_database()->with_read_lock([&]() {
return my->get_stats_for_time(open, interval); });
34 const fc::time_point_sec& end)
const
36 return my->_app.chain_database()->with_read_lock(
42 return my->_app.chain_database()->with_read_lock([&]() {
return my->get_lifetime_stats(); });
46 const fc::time_point_sec& open,
47 uint32_t interval)
const
49 return my->_app.chain_database()->with_read_lock([&]() {
51 account_stat.
statistic_map[account_name] = my->get_stats_for_time(open, interval).statistic_map[account_name];
57 const fc::time_point_sec& start,
58 const fc::time_point_sec& end)
const
60 return my->_app.chain_database()->with_read_lock([&]() {
70 return my->_app.chain_database()->with_read_lock([&]() {
72 account_stat.
statistic_map[account_name] = my->get_lifetime_stats().statistic_map[account_name];
#define ACCOUNT_STATISTICS_PLUGIN_NAME
account_statistics_api(const scorum::app::api_context &ctx)
account_statistics_api_impl(scorum::app::application &app)
statistics get_stats_for_interval_by_account_name(const account_name_type &account_name, const fc::time_point_sec &start, const fc::time_point_sec &end) const
statistics get_lifetime_stats_by_account_name(const account_name_type &account_name) const
statistics get_stats_for_time_by_account_name(const account_name_type &account_name, const fc::time_point_sec &open, uint32_t interval) const
statistics get_stats_for_time(const fc::time_point_sec &open, uint32_t interval) const
Gets statistics over the time window length, interval, that contains time, open.
statistics get_lifetime_stats() const
Returns lifetime statistics.
statistics get_stats_for_interval(const fc::time_point_sec &start, const fc::time_point_sec &stop) const
Aggregates statistics over a time interval.
fc::fixed_string_16 account_name_type
std::map< account_name_type, account_statistic > statistic_map