LogDoctor/docs/html/classDbQuery.html

55 KiB

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

Public Member Functions

void setDialogLevel (const DialogsLevel new_level) noexcept
 Returns the Dialogs level.
 
void setDbPath (std::string &&path) noexcept
 Sets the path for the logs Collection database.
 
void refreshDates (std::optional< database_dates_t > &result) noexcept
 Refreshes the dates which are available in the database.
 
void getWarningsData (std::optional< stats_warn_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView hour_) const
 Retrieves the data needed for the Warnings statistics.
 
void getSpeedData (std::optional< stats_speed_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, QStringView protocol_f, QStringView method_f, QStringView uri_f, QStringView query_f, QStringView response_f) const
 Retrieves the data needed for the Speed statistics.
 
void getItemsCount (std::optional< stats_count_items_t > &result, QStringView web_server, QStringView year, QStringView month, QStringView day, QStringView log_field) const
 Retrieves the data needed for the Counts statistics.
 
void getDaytimeCounts (std::optional< stats_day_items_t > &result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_, QStringView field_filter) const
 Retrieves the data needed for the Daytime statistics.
 
void getRelationalCountsDay (std::optional< stats_relat_items_t > &result, QStringView web_server, QStringView year_, QStringView month_, QStringView day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2) const
 Retrieves the data needed for the Relationsl statistics.
 
void getRelationalCountsPeriod (std::optional< stats_relat_items_t > &result, QStringView web_server, QStringView from_year_, QStringView from_month_, QStringView from_day_, QStringView to_year_, QStringView to_month_, QStringView to_day_, const LogField log_field_1_, QStringView field_filter_1, const LogField log_field_2_, QStringView field_filter_2) const
 Retrieves the data needed for the Relational statistics.
 
void getGlobalCounts (std::optional< GlobalsData > &result, QStringView web_server, const stats_dates_t &dates) const
 Retrieves the data needed for the Global statistics.
 

Private Member Functions

const QString & getDbField (const LogField fld) const
 Returns the database field corresponding to the relative log field.
 
const QString & getDbField (QStringView tr_fld) const
 Returns the database field corresponding to the relative log field.
 
int getMonthNumber (QStringView month_str) const
 Returns the month number in the year.
 

Static Private Member Functions

static int getMinuteGap (const int minute, const int gap=10)
 Returns the minute gap for the given minute with the given gap.
 
static int getMonthDays (const int year, const int month)
 Returns the number of days for a given month.
 
static int countDays (const int from_year, const int from_month, const int from_day, const int to_year, const int to_month, const int to_day)
 Returns the number of days in a given period.
 
static int countMonths (const int from_year, const int from_month, const int to_year, const int to_month) noexcept
 Returns the number of months in a given period.
 

Member Function Documentation

◆ countDays()

int DbQuery::countDays ( const int from_year,
const int from_month,
const int from_day,
const int to_year,
const int to_month,
const int to_day )
staticprivate

Returns the number of days in a given period.

Parameters
from_yearThe initial year
from_monthThe initial month
from_dayThe initial day
to_yearThe final Year
to_monthThe final month
to_dayThe final day
Returns
The number of days
Exceptions
DateTimeException

◆ countMonths()

int DbQuery::countMonths ( const int from_year,
const int from_month,
const int to_year,
const int to_month )
staticprivatenoexcept

Returns the number of months in a given period.

Parameters
from_yearThe initial year
from_monthThe initial month
to_yearThe final Year
to_monthThe final month
Returns
The number of months in the period

◆ getDaytimeCounts()

void DbQuery::getDaytimeCounts ( std::optional< stats_day_items_t > & result,
QStringView web_server,
QStringView from_year_,
QStringView from_month_,
QStringView from_day_,
QStringView to_year_,
QStringView to_month_,
QStringView to_day_,
const LogField log_field_,
QStringView field_filter ) const

Retrieves the data needed for the Daytime statistics.

Parameters
resultHolds the data only if the operation completed succssfully
web_serverThe ID of the Web Server to use
from_year_The initial year
from_month_The initial month
from_day_The initial day
to_year_The final year
to_month_The final month
to_day_The final day
log_field_The log field to filter
field_filterThe filter to apply
Exceptions
VoidException
CrapviewException
ConversionException
DateTimeException

◆ getDbField() [1/2]

const QString & DbQuery::getDbField ( const LogField fld) const
private

Returns the database field corresponding to the relative log field.

Parameters
fldThe log field
Returns
The database field
Exceptions
CrapviewException

◆ getDbField() [2/2]

const QString & DbQuery::getDbField ( QStringView tr_fld) const
private

Returns the database field corresponding to the relative log field.

Parameters
tr_fldThe log field, hendles translated text
Returns
The database field
Exceptions
CrapviewException

◆ getGlobalCounts()

void DbQuery::getGlobalCounts ( std::optional< GlobalsData > & result,
QStringView web_server,
const stats_dates_t & dates ) const

Retrieves the data needed for the Global statistics.

Parameters
resultHolds the data only if the operation completed succssfully
web_serverThe ID of the Web Server to use
datesThe dates to query
Exceptions
VoidException
CrapviewException
ConversionException

◆ getItemsCount()

void DbQuery::getItemsCount ( std::optional< stats_count_items_t > & result,
QStringView web_server,
QStringView year,
QStringView month,
QStringView day,
QStringView log_field ) const

Retrieves the data needed for the Counts statistics.

Parameters
resultHolds the data only if the operation completed succssfully
web_serverThe ID of the Web Server to use
yearThe year
monthThe month
dayThe day
log_fieldThe log field
Exceptions
VoidException
CrapviewException
DateTimeException

◆ getMinuteGap()

int DbQuery::getMinuteGap ( const int minute,
const int gap = 10 )
staticprivate

Returns the minute gap for the given minute with the given gap.

Parameters
minuteThe minute of the hour
gapThe gap used to split the hour
Returns
The gap index
Exceptions
DateTimeException

◆ getMonthDays()

int DbQuery::getMonthDays ( const int year,
const int month )
staticprivate

Returns the number of days for a given month.

Parameters
yearThe year, used to handle leap years
monthThe month
Returns
The number of days
Exceptions
DateTimeException

◆ getMonthNumber()

int DbQuery::getMonthNumber ( QStringView month_str) const
private

Returns the month number in the year.

Parameters
month_strThe month
Returns
The month number
Exceptions
DateTimeException

◆ getRelationalCountsDay()

void DbQuery::getRelationalCountsDay ( std::optional< stats_relat_items_t > & result,
QStringView web_server,
QStringView year_,
QStringView month_,
QStringView day_,
const LogField log_field_1_,
QStringView field_filter_1,
const LogField log_field_2_,
QStringView field_filter_2 ) const

Retrieves the data needed for the Relationsl statistics.

Used when querying a single day

Parameters
resultHolds the data only if the operation completed succssfully
web_serverThe ID of the Web Server to use
year_The year
month_The month
day_The day
log_field_1_The first log field to filter
field_filter_1The filter to apply to the first field
log_field_2_The second log field to filter
field_filter_2The filter to apply to the second fiend
Exceptions
VoidException
CrapviewException
ConversionException
DateTimeException
See also
getRelationalCountsPeriod()

◆ getRelationalCountsPeriod()

void DbQuery::getRelationalCountsPeriod ( std::optional< stats_relat_items_t > & result,
QStringView web_server,
QStringView from_year_,
QStringView from_month_,
QStringView from_day_,
QStringView to_year_,
QStringView to_month_,
QStringView to_day_,
const LogField log_field_1_,
QStringView field_filter_1,
const LogField log_field_2_,
QStringView field_filter_2 ) const

Retrieves the data needed for the Relational statistics.

Used when querying a period of time

Parameters
resultHolds the data only if the operation completed succssfully
web_serverThe ID of the Web Server to use
from_year_The initial year
from_month_The initial month
from_day_The initial day
to_year_The final year
to_month_The final month
to_day_The final day
log_field_1_The first log field to filter
field_filter_1The filter to apply to the first field
log_field_2_The second log field to filter
field_filter_2The filter to apply to the second fiend
Exceptions
VoidException
CrapviewException
ConversionException
DateTimeException
See also
getRelationalCountsDay()

◆ getSpeedData()

void DbQuery::getSpeedData ( std::optional< stats_speed_items_t > & result,
QStringView web_server,
QStringView year_,
QStringView month_,
QStringView day_,
QStringView protocol_f,
QStringView method_f,
QStringView uri_f,
QStringView query_f,
QStringView response_f ) const

Retrieves the data needed for the Speed statistics.

Parameters
resultHolds the data only if the operation completed succssfully
web_serverThe ID of the Web Server to use
year_The year
month_The month
day_The day
protocol_fThe filter for the Protocol field
method_fThe filter for the Method field
uri_fThe filter for the URI field
query_fThe filter for the Query field
response_fThe filter for the Response field
Exceptions
VoidException
CrapviewException
ConversionException
DateTimeException

◆ getWarningsData()

void DbQuery::getWarningsData ( std::optional< stats_warn_items_t > & result,
QStringView web_server,
QStringView year_,
QStringView month_,
QStringView day_,
QStringView hour_ ) const

Retrieves the data needed for the Warnings statistics.

Parameters
resultHolds the data only if the operation completed succssfully
web_serverThe ID of the Web Server to use
year_The year
month_The month
day_The day
hour_The hour
Exceptions
VoidException
ConversionException
DateTimeException

◆ refreshDates()

void DbQuery::refreshDates ( std::optional< database_dates_t > & result)
noexcept

Refreshes the dates which are available in the database.

Parameters
resultHolds the data only if the operation completed succssfully
Exceptions
VoidException
ConversionException

◆ setDbPath()

void DbQuery::setDbPath ( std::string && path)
noexcept

Sets the path for the logs Collection database.

See also
Crapview::setDbPath()

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

Generated by doxygen 1.10.0 </html>