Further changes in report logic, need to work on performance now!

This commit is contained in:
Andre Lorbach 2009-11-16 18:02:25 +01:00
parent f2e748d0e5
commit 17920d8762
3 changed files with 36 additions and 6 deletions

View File

@ -668,11 +668,20 @@ class LogStreamDB extends LogStream {
else
$szLimitSql = "";
// Create SQL Where Clause!
if ( $this->_SQLwhereClause == "" )
{
$res = $this->CreateSQLWhereClause();
if ( $res != SUCCESS )
return $res;
}
// Create SQL String now!
$szSql = "SELECT " .
$myDBQueryFields .
"count(" . $myDBConsFieldName . ") as ItemCount " .
" FROM " . $this->_logStreamConfigObj->DBTableName .
$this->_SQLwhereClause .
" GROUP BY " . $myDBGroupByFieldName .
" ORDER BY " . $myDBSortedFieldName . " " . $szSortingOrder .
$szLimitSql ;
@ -724,7 +733,7 @@ class LogStreamDB extends LogStream {
// Copy helper variables, this is just for better readability
$szTableType = $this->_logStreamConfigObj->DBTableType;
// Check if fields are available
if ( !isset($dbmapping[$szTableType]['DBMAPPINGS'][$szConsFieldId]) || !isset($dbmapping[$szTableType]['DBMAPPINGS'][$szSortFieldId]) )
return ERROR_DB_DBFIELDNOTFOUND;
@ -790,11 +799,20 @@ class LogStreamDB extends LogStream {
else
$szLimitSql = "";
// Create SQL Where Clause!
if ( $this->_SQLwhereClause == "" )
{
$res = $this->CreateSQLWhereClause();
if ( $res != SUCCESS )
return $res;
}
// Create SQL String now!
$szSql = "SELECT " .
$myDBQueryFields .
"count(" . $myDBConsFieldName . ") as ItemCount " .
" FROM " . $this->_logStreamConfigObj->DBTableName .
$this->_SQLwhereClause .
" GROUP BY " . $myDBGroupByFieldName .
" ORDER BY " . $myDBSortedFieldName . " " . $szSortingOrder .
$szLimitSql ;
@ -1295,6 +1313,8 @@ class LogStreamDB extends LogStream {
// Output Debug Informations
OutputDebugMessage("LogStreamDB|CreateMainSQLQuery: Created SQL Query:<br>" . $szSql, DEBUG_DEBUG);
//print ("LogStreamDB|CreateMainSQLQuery: Created SQL Query:<br>" . $szSql);
// return success state if reached this point!
return SUCCESS;
}

View File

@ -100,9 +100,17 @@ class Report_monilog extends Report {
{
global $content, $severity_colors;
// Verify Datasource first!
if ( $this->verifyDataSource() == SUCCESS )
// Set Filter string
$this->_streamObj->SetFilter( $this->_filterString );
// Need to Open stream first!
$res = $this->_streamObj->Open( $this->_arrProperties, true );
if ( $res == SUCCESS )
{
//
// // Verify Datasource first!
// if ( $this->verifyDataSource() == SUCCESS )
// {
// Get Settings and set to global content variable
$content["report_title"] = $this->GetCustomTitle();
$content["report_comment"] = $this->GetCustomComment();
@ -147,6 +155,8 @@ class Report_monilog extends Report {
$this->ConsolidateEventsPerHost($arrHosts);
// ---
}
else
return $ret;
// Return success!
return SUCCESS;
@ -197,7 +207,7 @@ class Report_monilog extends Report {
global $content;
// Set Filter string
$this->_streamObj->SetFilter( $this->_filterString );
// $this->_streamObj->SetFilter( $this->_filterString );
// Now open the stream for data processing
$res = $this->_streamObj->Open( $this->_arrProperties, true );

View File

@ -87,9 +87,9 @@
<td class="line1" valign="top" align="center">{ZAEHLER}</td>
<td class="line1" valign="top" align="center">{FirstEvent_Date_Formatted}</td>
<td class="line1" valign="top" align="center">{LastEvent_Date_Formatted}</td>
<td class="line1" valign="top" align="center">{sourceproc}</td>
<td class="line1" valign="top" align="center"><a href="http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=sourceproc&q={sourceproc}" target="_blank">{sourceproc}</a></td>
<td class="line1" valign="top" align="center">{syslogseverity_text}</td>
<td class="line1" valign="top" align="center">{id}</td>
<td class="line1" valign="top" align="center"><a href="http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=id&q={id}" target="_blank">{id}</a></td>
<td class="line1" valign="top" align="left">{msg}</td>
<!-- IF ItemCount>10 -->
<td class="lineColouredWhite" valign="top" align="right" bgcolor="#990000"><b>{ItemCount}</b></td>