def getAPJByRapCategory(oraconn): sqlstmt = 'select distinct rap_days||\' days \',rap_ord from legacy.supply_chain_region_rap where region=\'APJ\' order by rap_ord' datString = '' datrow = [] category = [] series = [] oscatcur = oracon.execSql(oraconn, sqlstmt) for catrec in oscatcur: series.append('\'' + catrec[0] + '\'') isqlstmt = 'select rap_category,rap_count from legacy.supply_chain_region_rap where region=\'APJ\' and rap_ord=' + str( catrec[1]) + ' order by rap_category' ostrendcur = oracon.execSql(oraconn, isqlstmt) for ostrec in ostrendcur: if searcharray(category, ostrec[0]) == 0: category.append(ostrec[0]) datrow.append(catrec[0] + ':' + str(ostrec[1])) ht = '' xmdat = html.generateMSLine(category, series, datrow, 100, '', '1') ht += '<div id="msapdiv" align="center">WW RAP by RAP category</div>\n' ht += '<script type="text/javascript">\n' ht += '\tvar chart = new FusionCharts("../FusionChartsFree/Charts/FCF_MSColumn2D.swf", "ChartId", "700", "500");\n' ht += '\tchart.setDataXML("' + xmdat + '");\n' ht += '\tchart.render("msapdiv");\n' ht += '\t</script>\n' return ht
def getSoftwareQtrAttachRate(oraconn): datString = '' datrow = [] category = [] series = [] sqlstmt = '' sqlstmt = 'select distinct qtr_year from legacy.Qtrly_soft_attach_trend ' sqlstmt += ' order by to_number(trim(substr(qtr_year,length(qtr_year)-4,5))||\'0\'||trim(substr(qtr_year,2,2)))' oscatcur = oracon.execSql(oraconn, sqlstmt) for catrec in oscatcur: series.append('\'' + catrec[0] + '\'') isqlstmt = 'select qtr_year,software,install_pers,to_number(trim(substr(qtr_year,length(qtr_year)-4,5))||\'0\'||trim(substr(qtr_year,2,2))) qtr ' isqlstmt += ' from legacy.Qtrly_soft_attach_trend where upper(software) NOT IN (\'GOLDEN LICENSE\',\'RECOVERY MANAGER FOR EXCHANGE \'||\'&\'||\' ORACLE\')' isqlstmt += ' and qtr_year=\'' + catrec[0] + '\' order by ' isqlstmt += ' to_number(trim(substr(qtr_year,length(qtr_year)-4,5))||\'0\'||trim(substr(qtr_year,2,2)))' ostrendcur = oracon.execSql(oraconn, isqlstmt) for ostrec in ostrendcur: if searcharray(category, ostrec[1]) == 0: category.append(ostrec[1]) datrow.append(catrec[0] + ':' + str(ostrec[2])) ht = '' xmdat = html.generateMSLine(category, series, datrow, 100, '', '1') ht += '<div id="mscoldiv" align="center">Inform Os Across Install Base</div>\n' ht += '<script type="text/javascript">\n' ht += '\tvar chart = new FusionCharts("../FusionChartsFree/Charts/FCF_MSColumn2D.swf", "ChartId", "1500", "600");\n' ht += '\tchart.setDataXML("' + xmdat + '");\n' ht += '\tchart.render("mscoldiv");\n' ht += '\t</script>\n' return ht
def getOsQtrlyTrend(oraconn): datString = '' datrow = [] category = [] series = [] sqlstmt = '' sqlstmt = 'select distinct os_version from legacy.display_trend_table where sortq >= 20091 order by os_version' oscatcur = oracon.execSql(oraconn, sqlstmt) for catrec in oscatcur: series.append('\'' + catrec[0] + '\'') isqlstmt = 'select distinct qtr,os_version,inserv_num,sortq from legacy.display_trend_table where os_version=\'' + catrec[ 0] + '\' and sortq >= 20091 order by sortq' ostrendcur = oracon.execSql(oraconn, isqlstmt) for ostrec in ostrendcur: if searcharray(category, 'Q ' + ostrec[3]) == 0: category.append('Q ' + ostrec[3]) datrow.append(ostrec[1] + ':' + str(ostrec[2]) + ':' + str(ostrec[3]) + ostrec[1] + '.html') ht = '' xmdat = html.generateMSLine(category, series, datrow, 3000, '', '1') ht += '<div id="msdiv" align="center">Inform Os Across Install Base</div>\n' ht += '<script type="text/javascript">\n' ht += '\tvar chart = new FusionCharts("../FusionChartsFree/Charts/FCF_MSLine.swf", "ChartId", "800", "300");\n' ht += '\tchart.setDataXML("' + xmdat + '");\n' ht += '\tchart.render("msdiv");\n' ht += '\t</script>\n' return ht
def build_disktype_free_trend(inservserial, oraconn): # number of vvs over time datString = '' datrow = [] category = [] series = [] sqlstmt = '' sqlstmt = 'select count(1) from legacy.pd_type_daily_freetrend where to_char(inservserial)=\'' + str( inservserial) + '\'' checkcur = oracon.execSql(oraconn, sqlstmt) for ckcur in checkcur: if ckcur[0] == 0: return '' sqlstmt = 'select max(round((free/1024)/1024,0))+10 from legacy.pd_type_daily_freetrend where to_char(inservserial)=\'' + str( inservserial) + '\'' maxcur = oracon.execSql(oraconn, sqlstmt) for mcur in maxcur: maxval = mcur[0] sqlstmt = 'select distinct pdtype from legacy.pd_type_daily_freetrend where to_char(inservserial)=\'' + str( inservserial) + '\' order by 1' oscatcur = oracon.execSql(oraconn, sqlstmt) for catrec in oscatcur: series.append('\'' + catrec[0] + '\'') isqlstmt = 'select to_char(datadate,\'mm/dd/YYYY\') dt,pdtype,round((free/1024)/1024,2) from legacy.pd_type_daily_freetrend ' isqlstmt += ' where to_char(inservserial)=\'' + str( inservserial) + '\' AND pdtype=\'' + catrec[0] + '\' and ' isqlstmt += ' datadate in (select datadate from (select datadate from legacy.pd_type_daily_freetrend where to_char(inservserial)= \'' + str( inservserial) + '\'' isqlstmt += ' order by datadate desc) where rownum < 31 ) order by 1' ostrendcur = oracon.execSql(oraconn, isqlstmt) for ostrec in ostrendcur: if searcharray(category, ostrec[0]) == 0: category.append(ostrec[0]) datrow.append(ostrec[1] + ':' + str(ostrec[2])) ht = '' xmdat = html.generateMSLine(category, series, datrow, maxval, '', '1') ht += '<fieldset><legend>Historical Free Capacity in TB</legend>' ht += '<div id="msdiv" align="center">Historical Free Capacity</div>\n' ht += '<script type="text/javascript">\n' ht += '\tvar chart = new FusionCharts("../FusionChartsFree/Charts/FCF_MSLine.swf", "ChartId", "500", "200");\n' ht += '\tchart.setDataXML("' + xmdat + '");\n' ht += '\tchart.render("msdiv");\n' ht += '\t</script>\n</fieldset>' return ht
def getDiskByModel(oraconn): sqlstmt = 'select MODEL, FC_PERCENT, NL_PERCENT, SSD_PERCENT from legacy.diskdistbymodel order by model' oscatcur = oracon.execSql(oraconn, sqlstmt) category = [] series = [] datrow = [] for catrec in oscatcur: category.append(catrec[0]) isqlstmt = 'select \'FC\' drivetype, FC_PERCENT from legacy.diskdistbymodel order by model' ostrendcur = oracon.execSql(oraconn, isqlstmt) for ostrec in ostrendcur: series.append(ostrec[0]) datrow.append(ostrec[0] + ':' + str(ostrec[1])) isqlstmt = ' select \'NL\' drivetype, NL_PERCENT from legacy.diskdistbymodel order by model' ostrendcur = oracon.execSql(oraconn, isqlstmt) for ostrec in ostrendcur: series.append(ostrec[0]) datrow.append(ostrec[0] + ':' + str(ostrec[1])) isqlstmt = 'select \'SSD\' drivetype, SSD_PERCENT from legacy.diskdistbymodel order by model ' ostrendcur = oracon.execSql(oraconn, isqlstmt) for ostrec in ostrendcur: series.append(ostrec[0]) datrow.append(ostrec[0] + ':' + str(ostrec[1])) ht = '' #print category; #print series; #print datrow; xmdat = html.generateMSLine(category, series, datrow, 100, '', '1') ht += '<div id="modeldiv" align="center">Disk Type by model</div>\n' ht += '<script type="text/javascript">\n' ht += '\tvar chart = new FusionCharts("../FusionChartsFree/Charts/FCF_MSBar2D.swf", "ChartId", "1000", "300");\n' ht += '\tchart.setDataXML("' + xmdat + '");\n' ht += '\tchart.render("modeldiv");\n' ht += '\t</script>\n' return ht