manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1475969 - /manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java
Date Thu, 25 Apr 2013 21:28:11 GMT
Author: kwright
Date: Thu Apr 25 21:28:10 2013
New Revision: 1475969

URL: http://svn.apache.org/r1475969
Log:
Dump jobqueue stats for all slow queries involving jobqueue table.

Modified:
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java?rev=1475969&r1=1475968&r2=1475969&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java
(original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfacePostgreSQL.java
Thu Apr 25 21:28:10 2013
@@ -1232,15 +1232,27 @@ public class DBInterfacePostgreSQL exten
       queryType += "ANALYZE ";
     IResultSet x = executeUncachedQuery(queryType+query,params,true,
       -1,null,null);
-    int k = 0;
-    while (k < x.getRowCount())
+    for (int k = 0; k < x.getRowCount(); k++)
     {
-      IResultRow row = x.getRow(k++);
+      IResultRow row = x.getRow(k);
       Iterator<String> iter = row.getColumns();
       String colName = (String)iter.next();
       Logging.db.warn(" Plan: "+row.getValue(colName).toString());
     }
     Logging.db.warn("");
+    if (query.indexOf("jobqueue") != -1)
+    {
+      // Dump jobqueue stats
+      x = executeUncachedQuery("select n_distinct, most_common_vals, most_common_freqs from
pg_stats where tablename='jobqueue' and attname='status'",null,true,-1,null,null);
+      for (int k = 0; k < x.getRowCount(); k++)
+      {
+        IResultRow row = x.getRow(k);
+        Iterator<String> iter = row.getColumns();
+        String colName = (String)iter.next();
+        Logging.db.warn(" Stats: "+row.getValue(colName).toString());
+      }
+      Logging.db.warn("");
+    }
   }
 
   



Mime
View raw message