[svn-commits] r180 - branches/advisor/src/front/analyzedb
thial01 at ingres.com
thial01 at ingres.com
Thu Aug 7 10:55:29 PDT 2008
Author: thial01
Date: 2008-08-07 10:55:29 -0700 (Thu, 07 Aug 2008)
New Revision: 180
Modified:
branches/advisor/src/front/analyzedb/Analyze.py
branches/advisor/src/front/analyzedb/Containers.py
branches/advisor/src/front/analyzedb/Draw.py
branches/advisor/src/front/analyzedb/analyzedb
Log:
Fixing some bugs in analyzedb - see #174
Modified: branches/advisor/src/front/analyzedb/Analyze.py
===================================================================
--- branches/advisor/src/front/analyzedb/Analyze.py 2008-08-07 14:16:02 UTC (rev 179)
+++ branches/advisor/src/front/analyzedb/Analyze.py 2008-08-07 17:55:29 UTC (rev 180)
@@ -375,14 +375,15 @@
self.__statistics.lock_wait.append([row[0], row[11]])
last_row = row
- self.__statistics.max_sessions = last_row[3]
- self.__statistics.total_rows = last_row[4]
- self.__statistics.selects_processed = last_row[5]
- self.__statistics.locks_per_tx = last_row[6]
- self.__statistics.max_locks = last_row[7]
- self.__statistics.workloadsize = self.__workloadsize
- self.__statistics.timespan = [time.ctime(results[0][0]), time.ctime(last_row[0])]
- self.__statistics.counts = [len(self.__tables), len(self.__attributes), len(self.__indexes)]
+ if last_row:
+ self.__statistics.max_sessions = last_row[3]
+ self.__statistics.total_rows = last_row[4]
+ self.__statistics.selects_processed = last_row[5]
+ self.__statistics.locks_per_tx = last_row[6]
+ self.__statistics.max_locks = last_row[7]
+ self.__statistics.workloadsize = self.__workloadsize
+ self.__statistics.timespan = [time.ctime(results[0][0]), time.ctime(last_row[0])]
+ self.__statistics.counts = [len(self.__tables), len(self.__attributes), len(self.__indexes)]
def __recommend(self, object, message, rpl = False):
Modified: branches/advisor/src/front/analyzedb/Containers.py
===================================================================
--- branches/advisor/src/front/analyzedb/Containers.py 2008-08-07 14:16:02 UTC (rev 179)
+++ branches/advisor/src/front/analyzedb/Containers.py 2008-08-07 17:55:29 UTC (rev 180)
@@ -87,7 +87,7 @@
current_connections = []
current_sessions = []
- max_session = 0
+ max_sessions = 0
total_rows = 0
selects_processed = 0
locks_per_tx = 0
Modified: branches/advisor/src/front/analyzedb/Draw.py
===================================================================
--- branches/advisor/src/front/analyzedb/Draw.py 2008-08-07 14:16:02 UTC (rev 179)
+++ branches/advisor/src/front/analyzedb/Draw.py 2008-08-07 17:55:29 UTC (rev 180)
@@ -9,13 +9,13 @@
def __init__(self, title, xlabel, ylabel):
self.data = []
+ Gnuplot.GnuplotOpts.default_term = "png"
self.gp = Gnuplot.Gnuplot(debug=0)
+ self.gp("set terminal png small size 800,600")
self.gp.xlabel(xlabel)
self.gp.ylabel(ylabel)
self.gp.title(title)
self.gp("set yrange [0:]")
- self.gp("set terminal png small size 800,600")
- """self.gp("set terminal postscript eps enhanced color size 17cm,12cm")"""
self.gp("set key box width 1 below")
def draw(self, file):
@@ -40,7 +40,8 @@
self.gp('set format x "%m-%d\\n%H:%M"')
def add_curve(self, rows, title):
- self.data.append(Gnuplot.Data(rows, using="1:2 with lines lw 2 title '%s', 0 with lines lc rgb 'white' " % title))
+ if len(rows) > 0:
+ self.data.append(Gnuplot.Data(rows, using="1:2 with lines lw 2 title '%s', 0 with lines lc rgb 'white' " % title))
def add_line(self, value, title):
self.data.append(Gnuplot.Func("%d" % value, with_="lines lw 2 title '%s'" % title))
Modified: branches/advisor/src/front/analyzedb/analyzedb
===================================================================
--- branches/advisor/src/front/analyzedb/analyzedb 2008-08-07 14:16:02 UTC (rev 179)
+++ branches/advisor/src/front/analyzedb/analyzedb 2008-08-07 17:55:29 UTC (rev 180)
@@ -18,7 +18,7 @@
from iianalyze.Present import *
from iianalyze.functions import *
-config.outputfolder = os.path.join(II_SYSTEM, "files", "analyzer")
+config.outputfolder = os.path.join(II_SYSTEM, "ingres", "files", "analyzer")
def showusage():
output("""
More information about the svn-commits
mailing list