Not yet rated

Problem

You want to see the server performance metric data to understand what is your applications AvgReqTime, AvgDBTime, etc.

Solution

Use the built-in GetMetricData(mode) function to get matric data.

Detailed explanation

 

To receive data, you must enable PerfMonitor in ColdFusion Administrator before executing the function. On Windows, this data is otherwise displayed in the Windows PerfMonitor.

Example:

<cfset performanceMonitorData = GetMetricData( "PERF_MONITOR" )
/>
<!--- you can also use "simple_load", "prev_req_time", or
"avg_req_time" --->

<cfoutput>
Current Perf Monitor data is: <br/>
Instance Name: #performanceMonitorData.InstanceName# <br/>
Page Hits: #performanceMonitorData.PageHits# <br/>
Request Queued: #performanceMonitorData.ReqQueued# <br/>
DB Hits: #performanceMonitorData.DBHits# <br/>
Request Running: #performanceMonitorData.ReqRunning# <br/>
Request Timed Out: #performanceMonitorData.ReqTimedOut# <br/>
Bytes In: #performanceMonitorData.BytesIn# <br/>
Bytes Out: #performanceMonitorData.BytesOut# <br/>
Avg Queue Time: #performanceMonitorData.AvgQueueTime# <br/>
Avg Request Time: #performanceMonitorData.AvgReqTime# <br/>
Avg DB Time: #performanceMonitorData.AvgDBTime# <br/>
</cfoutput>

 

 

 


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes