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> ...
Get Programming ColdFusion now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.