def simple_test(): from time import time print "running barchart test routine" dum = [ ("fddo4", 1318), ("cn1", 1472), ("cn2", 1411), ("fddo3", 1280), ("asc8", 1371), ("orb3", 1390), ("fddo1", 1418), ("asc4", 1292), ("dn2", 1381), ("fddo2", 1341), ("asc1", 1352), ("dn1", 1441), ] t0 = time() doc = SimpleDocument(title="Bar Chart", bgcolor=GREY1) dummydata = DataList() dummydata.load_tuples(dum) dummydata.sort() b = BarChart(dummydata) b.thresholds = (1300, 1400) b.title = "System Throughput (jobs/week)" doc.append(b) doc.append(Pre(str(dummydata))) doc.write("./html/bar.html") print "took", time() - t0, "sec."
def __init__(self, year=1997, month=1): SimpleDocument.__init__(self, bgcolor = PAGECOLOR) self.year = year self.month = month self.monthname = month_name[month] self.title = self.monthname + ' ' + str(self.year) self.ndays = mdays[month] now = time.strftime("%c", time.localtime(time.time())) self.append( '<P>', Font("Updated " + now, size = -1) ) self.append( Center( H(3,self.title) ) ) self.datetable = DateTable(cellpadding=6, cellspacing=2, border=3) self.jumper = '' for i in range(1, self.ndays+1): self.jumper = self.jumper + str(Href('#'+`month`+'-'+`i`, `i`)) + ' ' self.datetable.append(Day(self.year, self.month, i)) self.append( Center(self.jumper, html_escape='off') ) self.append('<P>') self.append( self.datetable )
def stacked_test(): from time import time print "running stacked barchart test routine" dum = [('fddo4', 1318, 456, 235, 290), ('fddo3', 1280, 560, 129, 295), ('fddo1', 1418, 1201, 490, 125), ('fddo2', 1341, 810, 466, 203)] t0 = time() doc = SimpleDocument(title='Stacked Bar Chart', bgcolor=GREY1) dummydata = DataList() dummydata.segment_names = ('User', 'System', 'I/O', 'Wait') dummydata.load_tuples(dum) dummydata.sort() b = StackedBarChart(dummydata) b.title = "System Load" doc.append(b) doc.append(Pre(str(dummydata))) doc.write('./html/stackedbar.html') print "took", time() - t0, 'sec.'
def simple_test(): from time import time print "running barchart test routine" dum = [('fddo4', 1318), ('cn1', 1472), ('cn2', 1411), ('fddo3', 1280), ('asc8', 1371), ('orb3', 1390), ('fddo1', 1418), ('asc4', 1292), ('dn2', 1381), ('fddo2', 1341), ('asc1', 1352), ('dn1', 1441)] t0 = time() doc = SimpleDocument(title='Bar Chart', bgcolor=GREY1) dummydata = DataList() dummydata.load_tuples(dum) dummydata.sort() b = BarChart(dummydata) b.thresholds = (1300, 1400) b.title = "System Throughput (jobs/week)" doc.append(b) doc.append(Pre(str(dummydata))) doc.write('./html/bar.html') print "took", time() - t0, 'sec.'
def stacked_test(): from time import time print "running stacked barchart test routine" dum = [ ('fddo4', 1318, 456, 235, 290), ('fddo3', 1280, 560, 129, 295), ('fddo1', 1418, 1201, 490, 125), ('fddo2', 1341, 810, 466, 203) ] t0 = time() doc = SimpleDocument(title='Stacked Bar Chart', bgcolor=GREY1) dummydata = DataList() dummydata.segment_names = ('User','System','I/O','Wait') dummydata.load_tuples(dum) dummydata.sort() b = StackedBarChart(dummydata) b.title = "System Load" doc.append(b) doc.append(Pre(str(dummydata))) doc.write('./html/stackedbar.html') print "took", time() - t0, 'sec.'
def simple_test(): from time import time print "running barchart test routine" dum = [ ('fddo4', 1318), ('cn1', 1472), ('cn2', 1411), ('fddo3', 1280), ('asc8', 1371), ('orb3', 1390), ('fddo1', 1418), ('asc4', 1292), ('dn2', 1381), ('fddo2', 1341), ('asc1', 1352), ('dn1', 1441) ] t0 = time() doc = SimpleDocument(title='Bar Chart', bgcolor=GREY1) dummydata = DataList() dummydata.load_tuples(dum) dummydata.sort() b = BarChart(dummydata) b.thresholds = (1300, 1400) b.title = "System Throughput (jobs/week)" doc.append(b) doc.append(Pre(str(dummydata))) doc.write('./html/bar.html') print "took", time() - t0, 'sec.'
def stacked_test(): from time import time print "running stacked barchart test routine" dum = [ ("fddo4", 1318, 456, 235, 290), ("fddo3", 1280, 560, 129, 295), ("fddo1", 1418, 1201, 490, 125), ("fddo2", 1341, 810, 466, 203), ] t0 = time() doc = SimpleDocument(title="Stacked Bar Chart", bgcolor=GREY1) dummydata = DataList() dummydata.segment_names = ("User", "System", "I/O", "Wait") dummydata.load_tuples(dum) dummydata.sort() b = StackedBarChart(dummydata) b.title = "System Load" doc.append(b) doc.append(Pre(str(dummydata))) doc.write("./html/stackedbar.html") print "took", time() - t0, "sec."