MHMDhub / enterprise-log-search-and-archive

Automatically exported from code.google.com/p/enterprise-log-search-and-archive
0 stars 0 forks source link

MySQL errors viewing query and load stats #146

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Viewing query and load statistics using the Admin -> Stats menu item

What is the expected output? What do you see instead?
System Dashboard should show charts and graphs.
Instead a bunch of "No data available" messages where charts and graphs should 
be.

What version of the product are you using? On what operating system?
Problem started with r891

Please provide any additional information below.
It looks like line 198 of the file elsa/web/lib/Datasource/Database.pm, has an 
erroneous exclamation point?
     if (!$q->has_groupby){

Removing the '!' seems to fix the behavior.  With the character, MySQL errors 
appear in the web.log and parameters are missing from the "WHERE" clause:

$ grep "3600" elsa-stats | head -n 1
query: SELECT SUM(count) AS `_count`, CAST(UNIX_TIMESTAMP(timestamp)/3600 AS 
unsigned) AS `_groupby`                                                         
      FROM (SELECT host_id, INET_NTOA(host_id) AS host, timestamp, class, count 
FROM host_stats t1 JOIN classes t2 ON (t1.class_id=t2.id) WHERE ) derived GROUP 
BY _groupby ORDER BY _groupby ASC LIMIT 0,168

With the character removed, the "WHERE" clause looks correct:
query: SELECT SUM(count) AS `_count`, CAST(UNIX_TIMESTAMP(timestamp)/3600 AS 
unsigned) AS `_groupby`, host_id, host, timestamp AS timestamp, class, count AS 
count FROM (SELECT host_id, INET_NTOA(host_id) AS host, timestamp, class, count 
FROM host_stats t1 JOIN classes t2 ON (t1.class_id=t2.id) WHERE timestamp>=? 
AND timestamp<=? ) derived GROUP BY _groupby ORDER BY _groupby ASC LIMIT 0,168

Original issue reported on code.google.com by kebut...@gmail.com on 28 May 2013 at 5:50

GoogleCodeExporter commented 8 years ago
I should point out that the elsa-stats file I'm grepping is really a snippet of 
web.log.

Original comment by kebut...@gmail.com on 28 May 2013 at 5:54

GoogleCodeExporter commented 8 years ago
Fixed in 893

Original comment by mchol...@gmail.com on 28 May 2013 at 4:30