Scorum
blockchain_statistics_api.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 #include <fc/api.hpp>
5 
6 #ifndef API_BLOCKCHAIN_STATISTICS
7 #define API_BLOCKCHAIN_STATISTICS "blockchain_statistics_api"
8 #endif
9 
10 namespace scorum {
11 namespace app {
12 struct api_context;
13 }
14 } // namespace scorum
15 
16 namespace scorum {
17 namespace blockchain_monitoring {
18 
19 namespace detail {
20 class blockchain_statistics_api_impl;
21 }
22 
33 {
34 public:
36 
37  void on_api_startup();
38 
42 
49  statistics get_stats_for_time(const fc::time_point_sec& open, uint32_t interval) const;
50 
57  statistics get_stats_for_interval(const fc::time_point_sec& start, const fc::time_point_sec& stop) const;
58 
63 
65 
66 private:
67  std::shared_ptr<detail::blockchain_statistics_api_impl> my;
68 };
69 } // namespace blockchain_monitoring
70 } // namespace scorum
71 
73  (get_stats_for_time)(get_stats_for_interval)(get_lifetime_stats))
statistics get_stats_for_interval(const fc::time_point_sec &start, const fc::time_point_sec &stop) const
Aggregates statistics over a time interval.
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.
Definition: asset.cpp:15