6 namespace common_statistics {
10 typedef typename chainbase::get_index_type<Bucket>::type bucket_index;
28 const auto& bucket_idx =
_app.
chain_database()->template get_index<bucket_index, by_bucket>();
29 auto itr = bucket_idx.lower_bound(boost::make_tuple(interval, open));
31 if (itr != bucket_idx.end())
37 template <
typename Plugin>
41 const auto& bucket_itr =
_app.
chain_database()->template get_index<bucket_index, by_bucket>();
43 auto size_itr = sizes.rbegin();
49 while (size_itr != sizes.rend() && time < end)
51 auto itr = bucket_itr.find(boost::make_tuple(*size_itr, time));
53 while (itr != bucket_itr.end() && itr->seconds == *size_itr && time + itr->seconds <= end)
70 const auto& bucket_idx =
_app.
chain_database()->template get_index<bucket_index, by_bucket>();
71 auto itr = bucket_idx.find(boost::make_tuple(
LIFE_TIME_PERIOD, fc::time_point_sec()));
73 if (itr != bucket_idx.end())
std::shared_ptr< chain::database > chain_database() const
std::shared_ptr< abstract_plugin > get_plugin(const std::string &name) const
Statistic get_lifetime_stats() const
common_statistics_api_impl(scorum::app::application &app, const std::string &name)
Statistic get_stats_for_time(const fc::time_point_sec &open, uint32_t interval) const
const std::string _plugin_name
common_statistics_api_impl base_api_impl
scorum::app::application & _app
Statistic get_stats_for_interval(const fc::time_point_sec &start, const fc::time_point_sec &end) const