ColdFusion 9.0 Resources |
ColdFusion Server Monitor APIContents [Hide]Use the Server Monitor API to programmatically retrieve all the data that the Server Monitor collects. The servermonitoring.cfc ColdFusion component contains methods that you call to perform Server Monitor tasks. For example, use the getAverageResponseTime method to get the average response time for the server. To view the methods, method arguments, and documentation for the Server Monitor API, use the CFC Explorer. To do so, go to http://localhost:8500/CFIDE/adminapi/servermonitoring.cfc. Use the Server Monitor API
ExampleThe following example uses the Server Monitor API to list the data sources to which the ColdFusion Server is connected and the number of connections: <cfscript> // Login to the ColdFusion Administrator. adminObj = createObject("component","cfide.adminapi.administrator"); adminObj.login("admin"); // Instantiate the Server Monitor object. myObj = createObject("component","cfide.adminapi.servermonitoring"); // Get the dsn pool data array dbpool = myObj.getDbPoolStats(); </cfscript> <!--- List the data sources ---> The ColdFusion server is connected to the following data sources:<br /> <cfloop index="i" from="1" to="#ArrayLen(dbpool)#"> <cfoutput>#dbpool[i].DSN# #dbpool[i].TOTALCONNECTIONCOUNT#<br /></cfoutput> </cfloop> |