parent
c45836efa7
commit
92cdee4e55
|
@ -122,6 +122,7 @@ set(PROJECT_SOURCES
|
|||
|
||||
modules/crapview/crapview.h
|
||||
modules/crapview/crapview.cpp
|
||||
modules/crapview/modules/lib.h
|
||||
modules/crapview/modules/filters.h
|
||||
modules/crapview/modules/filters.cpp
|
||||
modules/crapview/modules/query.h
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
#ifndef LOGDOCTOR__CRAPVIEW__LIB_H
|
||||
#define LOGDOCTOR__CRAPVIEW__LIB_H
|
||||
|
||||
|
||||
#include <array>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <QHash>
|
||||
|
||||
|
||||
#define CRAPVIEW_DATA_TYPEDEFS\
|
||||
using stats_dates_t = std::map<int, std::map<int, std::vector<int>>>;\
|
||||
using stats_warn_items_t = std::vector<std::vector<std::vector<std::array<QString,18>>>>;\
|
||||
using stats_speed_items_t = std::vector<std::tuple<qint64, std::array<QString,6>>>;\
|
||||
using stats_day_items_t = std::unordered_map<int, std::unordered_map<int, int>>;\
|
||||
using stats_relat_items_t = std::vector<std::tuple<qint64, int>>;\
|
||||
using stats_count_items_t = std::multimap<unsigned, QString>;\
|
||||
using database_dates_t = std::map<int, stats_dates_t>;
|
||||
|
||||
|
||||
struct RecurrenceData final
|
||||
{
|
||||
QHash<QString, size_t> protocol;
|
||||
QHash<QString, size_t> method;
|
||||
QHash<QString, size_t> uri;
|
||||
QHash<QString, size_t> user_agent;
|
||||
};
|
||||
|
||||
struct TrafficData final
|
||||
{
|
||||
// ( date_str, count )
|
||||
std::tuple<QString, QString> date;
|
||||
// { day_name : total_count } // 0:monday, ..., 7:sunday
|
||||
std::array<double,7> day{ 0, 0, 0, 0, 0, 0, 0 };
|
||||
// { hour : total_count }
|
||||
std::array<double,24> 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
|
Loading…
Reference in New Issue