#ifndef LOGDOCTOR__CRAPVIEW__LIB_H #define LOGDOCTOR__CRAPVIEW__LIB_H #include #include #include #define CRAPVIEW_DATA_TYPEDEFS\ using stats_dates_t = std::map>>;\ using stats_warn_items_t = std::vector>>>;\ using stats_speed_items_t = std::vector>>;\ using stats_day_items_t = std::unordered_map>;\ using stats_relat_items_t = std::vector>;\ using stats_count_items_t = std::multimap;\ using database_dates_t = std::map; struct RecurrenceData final { QHash protocol; QHash method; QHash uri; QHash user_agent; }; struct TrafficData final { // ( date_str, count ) std::tuple date; // { day_name : total_count } // 0:monday, ..., 7:sunday std::array day{ 0, 0, 0, 0, 0, 0, 0 }; // { hour : total_count } std::array hour{ .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0, .0 }; }; struct Perfs final { size_t max{ 0ul }; size_t total{ 0ul }; size_t count{ 0ul }; }; struct PerformanceData final { // [ max, total, count ] Perfs time_taken; // [ max, total, count ] Perfs bytes_sent; // [ max, total, count ] Perfs bytes_recv; }; struct GlobalsData final { RecurrenceData recurs; TrafficData traf; PerformanceData perf; size_t req_count{ 0 }; // total number of requests GlobalsData() noexcept = default; GlobalsData(GlobalsData&&) noexcept = default; GlobalsData& operator =(GlobalsData&&) noexcept = default; Q_DISABLE_COPY(GlobalsData) }; #endif // LOGDOCTOR__CRAPVIEW__LIB_H