Name
GetMetricData — New as of ColdFusion 4.5
Synopsis
GetMetricData(mode)Depending on mode, returns data
representing information about the performance of the ColdFusion
server. The following modes may be used by GetMetricData( ):
-
Perf_Monitor Returns a ColdFusion structure containing Performance Monitor data (Windows NT) or CFSTAT data (on Unix/Linux). For this mode to work on Windows NT systems, the Enable Performance Monitoring option must be checked in the Debugging section of the ColdFusion Administrator.
-
Simple_Load Returns a number representing the load on the server. This number is produced by an internal algorithm based on ColdFusion queue depths.
-
Prev_Req_Time Returns a number representing the previous request time in milliseconds. This metric can calculate server load using the formula:
Load (as a percentage) = Prev_Req_Time / Max_Allowable_Response_Time_In_Milliseconds * 100
-
Avg_Req_Time Returns a number representing the average request time in milliseconds. This metric can calculate load using the formula:
Load (as a percentage) = Avg_Req_Time / Max_Allowable_Response_Time_In_Milliseconds * 100
The following example demonstrates the four modes available to the
GetMetricData( ) function:
<CFSET PerformanceMonitoring = GetMetricData("Perf_monitor")> <CFSET Load = GetMetricData("Simple_Load")> <CFSET PreviousRequestTime = GetMetricData("Prev_Req_Time")> <CFSET AverageRequestTime = GetMetricData("Avg_Req_Time")> <CFOUTPUT> Load: #Load#<BR> Previous Request Time: #PreviousRequestTime#<BR> ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access