LogDoctor/docs/html/classCrapview.html

63 KiB

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> <head> </head>
LogDoctor 2.00
Parse Apache2/Nginx/IIS logs and create statistics
Loading...
Searching...
No Matches

Crapview. More...

#include <crapview.h>

Public Member Functions

const int & getDialogsLevel ()
 Returns the Dialogs level.
 
void setDialogsLevel (const int &new_level)
 Sets the new Dialogs level.
 
void setChartsTheme (const int &new_theme_id)
 Sets the new charts theme to use.
 
void setDbPath (const std::string &path)
 Sets the new path for the logs Collection database. More...
 
const QString parseBooleanFilter (const QString &filter_str)
 Parses a filter for a database field with boolean type. More...
 
const QString parseNumericFilter (const QString &filter_str)
 Parses a filter for a log field with integer type. More...
 
const QString parseTextualFilter (const QString &filter_str)
 Parses a filter for a log field with text type. More...
 
const QString getLogFieldString (const int &field_id)
 Returns the printable log field corresponding to the given ID. More...
 
const int getLogFieldID (const QString &field_str)
 Returns the log field ID corresponding to the given printable field. More...
 
const int getMonthNumber (const QString &month_str)
 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)
 Returns le list of available years, for the given web server. More...
 
const QStringList getMonths (const QString &web_server, const QString &year)
 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)
 Returns le list of available days in the given month and year, for the given web server. More...
 
const QStringList getHours ()
 Returns all the hours of the day. More...
 
const QStringList getFields (const std::string &tab)
 Returns a list of the fields for the given tab. More...
 
void updateWarn (QTableWidget *table, const QString &web_server)
 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)
 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)
 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)
 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)
 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)
 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)
 Retrieves the data to fill the Globals stats. More...
 

Private Member Functions

const QString printableDate (const int &year, const int &month, const int &day)
 Returns a string of the given date in the format YYY-MM-DD. More...
 
const QString printableTime (const int &hour, const int &minute, const int &second)
 Returns a string of the given time in the format HH:MM:SS. More...
 
const QString printableWarn (const int &value)
 Returns a string corresponding to the given value. More...
 

Detailed Description

Crapview.

Performs operations related to the visualization of the statistics

Member Function Documentation

◆ calcGlobals()

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 
)

Retrieves the data to fill the Globals stats.

Parameters
recur_listThe list which will hold the printable recurrencies
traffic_listThe list which will hold the printable traffics
perf_listThe list which will hold the printable performances
work_listThe list which will hold the printable overall work infos
web_serverThe printable Web Server name
Returns
Whether the operation has been successful or not

◆ drawCount()

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 
)

Draws the chart and fills the table for the Counts stats.

Parameters
tableThe table widget
chartThe chart widget
themeThe theme to use for the chart
fontsThe map holding the fonts
web_serverThe printable Web Server name
yearThe year
monthThe printable month name
dayThe day
fieldThe printable log field

◆ drawDay()

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 
)

Draws the chart for the Daytime stats.

Parameters
chartThe chart widget
themeThe theme to use for the chart
fontsThe map holding the fonts
web_serverThe printable Web Server name
yearThe initial year
monthThe initial printable month name
dayThe initial day
yearThe final year
monthThe final printable month name
dayThe finl day
fieldThe printable log field
filterThe give filter string

◆ drawRelat()

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 
)

Draws the chart for the Relational stats.

Parameters
chartThe chart widget
themeThe theme to use for the chart
fontsThe map holding the fonts
web_serverThe printable Web Server name
yearThe initial year
monthThe initial printable month name
dayThe initial day
yearThe final year
monthThe final printable month name
dayThe finl day
field_1The first printable log field
filter_1The give filter string for the first field
field_2The second printable log field
filter_2The give filter string for the second field

◆ drawSpeed()

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 
)

Draws the chart and fills the table for the Speed stats.

Parameters
tableThe table widget
chartThe chart widget
themeThe theme to use for the chart
fontsThe map holding the fonts
web_serverThe printable Web Server name
yearThe year
monthThe printable month name
dayThe day
protocolThe given filter for the Protocol
methodThe given filter for the Method
uriThe given filter for the URI
queryThe given filter for the Query
responseThe given filter for the Response

◆ drawWarn()

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 
)

Draws the chart and fills the table for the Warnings stats.

Parameters
tableThe table widget
chartThe chart widget
themeThe theme to use for the chart
fontsThe map holding the fonts
web_serverThe printable Web Server name
yearThe year
monthThe printable month name
dayThe day
houtThe hour

◆ getDays()

const QStringList Crapview::getDays ( const QString &  web_server,
const QString &  year,
const QString &  month 
)

Returns le list of available days in the given month and year, for the given web server.

Parameters
web_serverThe printable Web Server name
yearThe year
monthThe printable month name
Returns
The list of days which are avaliable

◆ getFields()

const QStringList Crapview::getFields ( const std::string &  tab)

Returns a list of the fields for the given tab.

Parameters
tabThe stats tab
Returns
The list of fields

◆ getHours()

const QStringList Crapview::getHours ( )

Returns all the hours of the day.

Returns
The list of all the hours

◆ getLogFieldID()

const int Crapview::getLogFieldID ( const QString &  field_str)

Returns the log field ID corresponding to the given printable field.

Parameters
field_strThe log field
Returns
The ID of the log field

◆ getLogFieldString()

const QString Crapview::getLogFieldString ( const int &  field_id)

Returns the printable log field corresponding to the given ID.

The field gets translated to be printable before being returned

Parameters
field_idThe ID of the log fiels
Returns
The printable field

◆ getMonthNumber()

const int Crapview::getMonthNumber ( const QString &  month_str)

Returns the month number corresponding to the given printable month.

Parameters
month_StrThe printable month name
Returns
The month number

◆ getMonths()

const QStringList Crapview::getMonths ( const QString &  web_server,
const QString &  year 
)

Returns le list of available months in the given year, for the given web server.

Parameters
web_serverThe printable Web Server name
yearThe year
Returns
The list of printable month names which are avaliable

◆ getYears()

const QStringList Crapview::getYears ( const QString &  web_server)

Returns le list of available years, for the given web server.

Parameters
web_serverThe printable Web Server name
Returns
The list of yearss which are avaliable

◆ parseBooleanFilter()

const QString Crapview::parseBooleanFilter ( const QString &  filter_str)

Parses a filter for a database field with boolean type.

Parameters
field_strThe given filter
Returns
The resulting filter to apply at the query

◆ parseNumericFilter()

const QString Crapview::parseNumericFilter ( const QString &  filter_str)

Parses a filter for a log field with integer type.

Parameters
field_strThe given filter
Returns
The resulting filter to apply at the query

◆ parseTextualFilter()

const QString Crapview::parseTextualFilter ( const QString &  filter_str)

Parses a filter for a log field with text type.

Parameters
field_strThe given filter
Returns
The resulting filter to apply at the query

◆ printableDate()

const QString Crapview::printableDate ( const int &  year,
const int &  month,
const int &  day 
)
private

Returns a string of the given date in the format YYY-MM-DD.

Parameters
yearThe year
monthThe month
dayThe day
Returns
The printable date

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
yearThe year
monthThe month
dayThe day
Returns
The printable date

◆ printableTime()

const QString Crapview::printableTime ( const int &  hour,
const int &  minute,
const int &  second 
)
private

Returns a string of the given time in the format HH:MM:SS.

Parameters
hourThe hour
minutThe minute
secondThe second
Returns
The printable time

◆ printableWarn()

const QString Crapview::printableWarn ( const int &  value)
private

Returns a string corresponding to the given value.

Used to convert numeric booleans [0,1] to string [FALSE,TRUE]

Parameters
valueThe value to convert
Returns
The corresponding printable string

◆ setDbPath()

void Crapview::setDbPath ( const std::string &  path)

Sets the new path for the logs Collection database.

See also
DbQuery::setDbPath()

◆ updateWarn()

void Crapview::updateWarn ( QTableWidget *  table,
const QString &  web_server 
)

Updates the database applying the changes which have been made to the table.

Parameters
tableThe Warnings stats table
web_serverThe printable Web Server name

The documentation for this class was generated from the following files:
  • logdoctor/modules/crapview/crapview.h
  • logdoctor/modules/crapview/crapview.cpp

Generated by doxygen 1.9.5 </html>