时间: 2021-07-31 作者:daque
<script language="c#" runat=server> void page_load(object sender, eventargs ev) {processinfo[] history = processmodelinfo.gethistory(100);for( int i=0; i<history.length; i++ ){ response.write("<table border>"); response.write("<tr><td>"); response.write("starttime<td>"+ history[i].starttime.tostring() + "<br>"); response.write("<tr><td>"); response.write("age<td>"+ history[i].age.tostring() + "<br>"); response.write("<tr><td>"); response.write("processid<td>"+ history[i].processid.tostring() + "<br>"); response.write("<tr><td>"); response.write("requestcount<td>" + history[i].requestcount.tostring()+ "<br>"); response.write("<tr><td>"); response.write("status<td>" + getprocessstatus( history[i].status ) + "<br>"); response.write("<tr><td>"); response.write("shutdownreason<td>" + getshutdownreason( history[i].shutdownreason) + "<br>"); response.write("<tr><td>"); response.write("peakmemoryused<td>" + history[i].peakmemoryused.tostring()+ "<br>"); response.write("</table><p><p>");} } public string getprocessstatus( processstatus ps ) {string s = "unknown";if( ps == processstatus.alive ) s = "alive";else if( ps == processstatus.shuttingdown ) s = "shutting down";else if( ps == processstatus.shutdown ) s = "shutdown";else if( ps == processstatus.terminated ) s = "terminated";return s; } public string getshutdownreason( processshutdownreason psr ) {string s = "unknown";if( psr == processshutdownreason.none ) s = "n/a";else if( psr == processshutdownreason.unexpected ) s = "unexpected";else if( psr == processshutdownreason.requestslimit ) s = "requests limit";else if( psr == processshutdownreason.requestqueuelimit ) s = "request queue limit";else if( psr == processshutdownreason.timeout ) s = "timeout";else if( psr == processshutdownreason.idletimeout ) s = "idle timeout";else if( psr == processshutdownreason.memorylimitexceeded ) s = "memory limit exceeded";return s; }</script>