![]() |
LogDoctor 2.00
Parse Apache2/Nginx/IIS logs and create statistics
|
#include <crapview.h>
Public Member Functions | |
const int & | getDialogsLevel () const |
Returns the Dialogs level. | |
void | setDialogsLevel (const int new_level) |
Sets the new Dialogs level. | |
void | setDbPath (const std::string &path) |
Sets the new path for the logs Collection database. More... | |
const QString | parseBooleanFilter (const QString &filter_str) const |
Parses a filter for a database field with boolean type. More... | |
const QString | parseNumericFilter (const QString &filter_str) const |
Parses a filter for a log field with integer type. More... | |
const QString | parseTextualFilter (const QString &filter_str) const |
Parses a filter for a log field with text type. More... | |
const QString | getLogFieldString (const int field_id) const |
Returns the printable log field corresponding to the given ID. More... | |
const int | getLogFieldID (const QString &field_str) const |
Returns the log field ID corresponding to the given printable field. More... | |
const int | getMonthNumber (const QString &month_str) const |
Returns the month number corresponding to the given printable month. More... | |
void | refreshDates () |
Refreshes the list of the dates which are available in the database. | |
void | clearDates () |
Erases the list of available dates. | |
const QStringList | getYears (const QString &web_server) const |
Returns le list of available years, for the given web server. More... | |
const QStringList | getMonths (const QString &web_server, const QString &year) const |
Returns le list of available months in the given year, for the given web server. More... | |
const QStringList | getDays (const QString &web_server, const QString &year, const QString &month) const |
Returns le list of available days in the given month and year, for the given web server. More... | |
const QStringList | getHours () const |
Returns all the hours of the day. More... | |
const QStringList | getFields (const std::string &tab) const |
Returns a list of the fields for the given tab. More... | |
void | updateWarn (QTableWidget *table, const QString &web_server) const |
Updates the database applying the changes which have been made to the table. More... | |
void | drawWarn (QTableWidget *table, QtCharts::QChartView *chart, const QChart::ChartTheme &theme, const std::unordered_map< std::string, QFont > &fonts, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &hour) const |
Draws the chart and fills the table for the Warnings stats. More... | |
void | drawSpeed (QTableWidget *table, QtCharts::QChartView *chart, const QChart::ChartTheme &theme, const std::unordered_map< std::string, QFont > &fonts, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &protocol, const QString &method, const QString &uri, const QString &query, const QString &response) const |
Draws the chart and fills the table for the Speed stats. More... | |
void | drawCount (QTableWidget *table, QtCharts::QChartView *chart, const QChart::ChartTheme &theme, const std::unordered_map< std::string, QFont > &fonts, const QString &web_server, const QString &year, const QString &month, const QString &day, const QString &field) const |
Draws the chart and fills the table for the Counts stats. More... | |
void | drawDay (QtCharts::QChartView *chart, const QChart::ChartTheme &theme, const std::unordered_map< std::string, QFont > &fonts, const QString &web_server, const QString &from_year, const QString &from_month, const QString &from_day, const QString &to_year, const QString &to_month, const QString &to_day, const QString &field, const QString &filter) const |
Draws the chart for the Daytime stats. More... | |
void | drawRelat (QtCharts::QChartView *chart, const QChart::ChartTheme &theme, const std::unordered_map< std::string, QFont > &fonts, const QString &web_server, const QString &from_year, const QString &from_month, const QString &from_day, const QString &to_year, const QString &to_month, const QString &to_day, const QString &field_1, const QString &filter_1, const QString &field_2, const QString &filter_2) const |
Draws the chart for the Relational stats. More... | |
const bool | calcGlobals (std::vector< std::tuple< QString, QString > > &recur_list, std::vector< std::tuple< QString, QString > > &traffic_list, std::vector< std::tuple< QString, QString > > &perf_list, std::vector< QString > &work_list, const QString &web_server) const |
Retrieves the data to fill the Globals stats. More... | |
Performs operations related to the visualization of the statistics
const bool Crapview::calcGlobals | ( | std::vector< std::tuple< QString, QString > > & | recur_list, |
std::vector< std::tuple< QString, QString > > & | traffic_list, | ||
std::vector< std::tuple< QString, QString > > & | perf_list, | ||
std::vector< QString > & | work_list, | ||
const QString & | web_server | ||
) | const |
Retrieves the data to fill the Globals stats.
recur_list | The list which will hold the printable recurrencies |
traffic_list | The list which will hold the printable traffics |
perf_list | The list which will hold the printable performances |
work_list | The list which will hold the printable overall work infos |
web_server | The printable Web Server name |
void Crapview::drawCount | ( | QTableWidget * | table, |
QtCharts::QChartView * | chart, | ||
const QChart::ChartTheme & | theme, | ||
const std::unordered_map< std::string, QFont > & | fonts, | ||
const QString & | web_server, | ||
const QString & | year, | ||
const QString & | month, | ||
const QString & | day, | ||
const QString & | field | ||
) | const |
Draws the chart and fills the table for the Counts stats.
table | The table widget |
chart | The chart widget |
theme | The theme to use for the chart |
fonts | The map holding the fonts |
web_server | The printable Web Server name |
year | The year |
month | The printable month name |
day | The day |
field | The printable log field |
void Crapview::drawDay | ( | QtCharts::QChartView * | chart, |
const QChart::ChartTheme & | theme, | ||
const std::unordered_map< std::string, QFont > & | fonts, | ||
const QString & | web_server, | ||
const QString & | from_year, | ||
const QString & | from_month, | ||
const QString & | from_day, | ||
const QString & | to_year, | ||
const QString & | to_month, | ||
const QString & | to_day, | ||
const QString & | field, | ||
const QString & | filter | ||
) | const |
Draws the chart for the Daytime stats.
chart | The chart widget |
theme | The theme to use for the chart |
fonts | The map holding the fonts |
web_server | The printable Web Server name |
year | The initial year |
month | The initial printable month name |
day | The initial day |
year | The final year |
month | The final printable month name |
day | The finl day |
field | The printable log field |
filter | The give filter string |
void Crapview::drawRelat | ( | QtCharts::QChartView * | chart, |
const QChart::ChartTheme & | theme, | ||
const std::unordered_map< std::string, QFont > & | fonts, | ||
const QString & | web_server, | ||
const QString & | from_year, | ||
const QString & | from_month, | ||
const QString & | from_day, | ||
const QString & | to_year, | ||
const QString & | to_month, | ||
const QString & | to_day, | ||
const QString & | field_1, | ||
const QString & | filter_1, | ||
const QString & | field_2, | ||
const QString & | filter_2 | ||
) | const |
Draws the chart for the Relational stats.
chart | The chart widget |
theme | The theme to use for the chart |
fonts | The map holding the fonts |
web_server | The printable Web Server name |
year | The initial year |
month | The initial printable month name |
day | The initial day |
year | The final year |
month | The final printable month name |
day | The finl day |
field_1 | The first printable log field |
filter_1 | The give filter string for the first field |
field_2 | The second printable log field |
filter_2 | The give filter string for the second field |
void Crapview::drawSpeed | ( | QTableWidget * | table, |
QtCharts::QChartView * | chart, | ||
const QChart::ChartTheme & | theme, | ||
const std::unordered_map< std::string, QFont > & | fonts, | ||
const QString & | web_server, | ||
const QString & | year, | ||
const QString & | month, | ||
const QString & | day, | ||
const QString & | protocol, | ||
const QString & | method, | ||
const QString & | uri, | ||
const QString & | query, | ||
const QString & | response | ||
) | const |
Draws the chart and fills the table for the Speed stats.
table | The table widget |
chart | The chart widget |
theme | The theme to use for the chart |
fonts | The map holding the fonts |
web_server | The printable Web Server name |
year | The year |
month | The printable month name |
day | The day |
protocol | The given filter for the Protocol |
method | The given filter for the Method |
uri | The given filter for the URI |
query | The given filter for the Query |
response | The given filter for the Response |
void Crapview::drawWarn | ( | QTableWidget * | table, |
QtCharts::QChartView * | chart, | ||
const QChart::ChartTheme & | theme, | ||
const std::unordered_map< std::string, QFont > & | fonts, | ||
const QString & | web_server, | ||
const QString & | year, | ||
const QString & | month, | ||
const QString & | day, | ||
const QString & | hour | ||
) | const |
Draws the chart and fills the table for the Warnings stats.
table | The table widget |
chart | The chart widget |
theme | The theme to use for the chart |
fonts | The map holding the fonts |
web_server | The printable Web Server name |
year | The year |
month | The printable month name |
day | The day |
hout | The hour |
const QStringList Crapview::getDays | ( | const QString & | web_server, |
const QString & | year, | ||
const QString & | month | ||
) | const |
Returns le list of available days in the given month and year, for the given web server.
web_server | The printable Web Server name |
year | The year |
month | The printable month name |
const QStringList Crapview::getFields | ( | const std::string & | tab | ) | const |
Returns a list of the fields for the given tab.
tab | The stats tab |
const QStringList Crapview::getHours | ( | ) | const |
Returns all the hours of the day.
const int Crapview::getLogFieldID | ( | const QString & | field_str | ) | const |
Returns the log field ID corresponding to the given printable field.
field_str | The log field |
const QString Crapview::getLogFieldString | ( | const int | field_id | ) | const |
Returns the printable log field corresponding to the given ID.
The field gets translated to be printable before being returned
field_id | The ID of the log fiels |
const int Crapview::getMonthNumber | ( | const QString & | month_str | ) | const |
Returns the month number corresponding to the given printable month.
month_Str | The printable month name |
const QStringList Crapview::getMonths | ( | const QString & | web_server, |
const QString & | year | ||
) | const |
Returns le list of available months in the given year, for the given web server.
web_server | The printable Web Server name |
year | The year |
const QStringList Crapview::getYears | ( | const QString & | web_server | ) | const |
Returns le list of available years, for the given web server.
web_server | The printable Web Server name |
const QString Crapview::parseBooleanFilter | ( | const QString & | filter_str | ) | const |
Parses a filter for a database field with boolean type.
Boolean filters are not locale-dependant, meaning that English syntax must be used (TRUE,FALSE)
field_str | The given filter |
const QString Crapview::parseNumericFilter | ( | const QString & | filter_str | ) | const |
Parses a filter for a log field with integer type.
field_str | The given filter |
const QString Crapview::parseTextualFilter | ( | const QString & | filter_str | ) | const |
Parses a filter for a log field with text type.
field_str | The given filter |
void Crapview::setDbPath | ( | const std::string & | path | ) |
Sets the new path for the logs Collection database.
void Crapview::updateWarn | ( | QTableWidget * | table, |
const QString & | web_server | ||
) | const |
Updates the database applying the changes which have been made to the table.
table | The Warnings stats table |
web_server | The printable Web Server name |