<%@language="JScript"%> <% // perfstats.asp // This page allows the user to see the build times of the last few jobs // that have been requested on the build site (default is 10) // trim trailing spaces function rtrim(myStr,numspc) { var spaces = ""; for (i=0;i 0) scratch = scratch.substr(0, num); return scratch; } // Putting in Navagation Bar RW(""); RW(""); RW("
Current StatusBuild HistoryAdminStatisticsCrash Reports

"); // connect to DB var numRecords; var pageNumRecords = String(Request.Form("show")); var display = String(Request.Form("toggle")); numRecords = 10; // how many records to display if((pageNumRecords == "undefined") || (pageNumRecords == "") || (pageNumRecords == null)) { numRecords = 10; } // if user has selected display all records must set numRecords to 100 Percent so that syntax using TOP command is correct else if ( (pageNumRecords == "all") || (pageNumRecords == "ALL") || (pageNumRecords == "All") ) { numRecords = "100 PERCENT"; } else { numRecords = pageNumRecords; } // get the current user. IIS should be using windows authentication and // have anonymous users disabled WebPageUser = Request.ServerVariables("LOGON_USER"); //var ProjectName = "prophets"; // Form input to select number of records to display and select between master only or master/slave data view. Default is 10 records and master only. RW("" + ProjectName + " Build Statistics Page"); RW("

" + ProjectName + " Build Statistics Page

"); RW("
"); // Code to allow user to modify view to display slave data. RW("

Display:"); RW(" Master only\n"); RW(" Master and Slaves

\n"); // Form input for number of records to display RW("Enter number of records to show, 10 by default(times displayed are in minutes):

"); RW("\n"); RW("\n"); RW(""); %> <% // Open a connection with database and querry table view containing min, max and avg build time data var vConnectionString = "DATABASE=halobuild;DRIVER=SQL Server;SERVER=bungiesql01;uid=halotest_all;pwd=Q1w2e3r4"; DataBase = new ActiveXObject("ADODB.Connection"); DataBase.Open(vConnectionString); queryString = "SELECT * FROM prophetstblavg"; RS = DataBase.Execute(queryString); // Following Code displays the database data in a formated table. if (!RS.EOF) { Response.Write("\n"); for (i=0; i"+RS.Fields(i).Name + ""); } } while (!RS.EOF) { Response.Write("\n"); for (i=0; i" + BuildOptions[bcnum]); } else { Response.Write("\n"); for (i=0; i"+RS.Fields(i).Name + ""); } } while (! RS.EOF) { Response.Write("\n"); for (i=0; i N/A"); } // Check here for when we are creating the buildconfig column // Use the buildconfig values set in buildconfig.inc.asp to determine the build type and substitue build name else if(RS.Fields(i).Name == "buildconfig") { var bcnum = parseInt(s); RW("\n
" + s); } } RS.MoveNext(); } RS.Close(); delete RS; // Next is generating the Table showing the build breakdown times // Default querry that selects a set number of records and only shows the master data queryString = "SELECT TOP " + numRecords + " buildnum, buildconfig, machineid, totaltime / 60 AS 'Total Time', synccode / 60 AS 'Sync Code', synccontent / 60 AS 'Sync Content', buildbin / 60 AS 'Build Binaries', buildmaps / 60 AS 'Build Maps', propbin / 60 AS 'Prop Binaries', checkbin / 60 AS 'Checkin Binaries', zip / 60 AS 'Zip Source', wait / 60 AS Wait FROM prophetstblperf WHERE (machineid = 'master') ORDER BY id DESC"; // Check if user has selected Master/Slave display if (display == "slaves") { queryString = "SELECT TOP " + numRecords + " buildnum, buildconfig, machineid, totaltime / 60 AS 'Total Time', synccode / 60 AS 'Sync Code', synccontent / 60 AS 'Sync Content', buildbin / 60 AS 'Build Binaries', buildmaps / 60 AS 'Build Maps', propbin / 60 AS 'Prop Binaries', checkbin / 60 AS 'Checkin Binaries', zip / 60 AS 'Zip Source', wait / 60 AS Wait FROM prophetstblperf ORDER BY buildnum DESC"; } RS = DataBase.Execute(queryString); var BuildNum = Request.QueryString("build").Count; if(BuildNum != "0") { BuildNum = Request.QueryString("build"); var Query = "SELECT buildnum, buildconfig, machineid, totaltime / 60 AS 'Total Time', synccode / 60 AS 'Sync Code', synccontent / 60 AS 'Sync Content', buildbin / 60 AS 'Build Binaries', buildmaps / 60 AS 'Build Maps', propbin / 60 AS 'Prop Binaries', checkbin / 60 AS 'Checkin Binaries', zip / 60 AS 'Zip Source', wait / 60 AS Wait FROM prophetstblperf WHERE buildnum='" + BuildNum + "'"; RS = ExSQL(Query); } // Now Draw the Tables if (! RS.EOF) { Response.Write("\n
" + BuildOptions[bcnum]); } else if(RS.Fields(i).Name == "buildnum") { if(Request.QueryString("build").Count == 0) { RW("\n" + s + ""); } else { Response.Write("\n" + s); } } else { Response.Write("\n" + s); } } RS.MoveNext(); } RS.Close(); delete RS; function rtrim(s) { var str = new String(s); var len = str.indexOf(" "); var i = len; while (i < str.length) { if (str.substr(i,1) != " ") len = i+1; i++; } return(str.substr(0,len)); } function replaceAll(s, a, b) { var tmp = s; var flag=1; while(flag){ s = String(tmp.replace(a,b)); if (s==tmp) flag=0; else tmp=s; } return s; } %>
<% var BuildNum = Request.QueryString("build").Count; if(BuildNum != "0") { RW("BACK"); } %>