I hadn't seen this before, so I tried Matt's snippet.

It works fine on the "Ugly" port of CFMX Enterprise to Mac  OS X

On CFMX for J2EE Jrun  on Mac OS X i get the following error:

   Error Occurred While Processing Request

   The metrics service is not available.

   This exception is usually caused by service startup failure.
   Please check your server configuration.
�
   The error occurred in /Applications/JRun4/servers/cfmx1/
   cfusion/mycfmxapps/ServerUpTime.cfm: line 15

   13 : <cfset left = left-(60*minutes)>
   14 : <cfset seconds = int(left)>
   15 : <CFSET pmData = GetMetricData("PERF_MONITOR")>
   16 : <CFSET QueryName="MyQuery">
   17 : <!DOCTYPE HTML PUBLIC "-
It works fine on the "Ugly" port of CFMX Enterprise to Mac  OS X

I checked the docs and admin settings for both JRun and CFMX and could  
find nothing about
this service.

There were no errors or exceptions in the logs when starting CFMX.

Am I missing something?

Has anyone else got the GEtMetricData() function working on CFMXJ2ee on  
JRun?

TIA

Dick

> You can get a time-since-last-reboot and quite a bit more with this
> code.  I got it from the devex ages ago.  Can't remember the name of  
> the
> tag.
>
> --------------------------------------------
>  Matt Robertson       [EMAIL PROTECTED]
>  MSB Designs, Inc.  http://mysecretbase.com
> --------------------------------------------
>
> <cfset ticks = gettickcount()/1000>
> <cfset days = int(ticks/86400)>
> <cfset left = ticks-(86400*days)>
> <cfset hours = int(left/3600)>
> <cfset left = left-(3600*hours)>
> <cfset minutes = int(left/60)>
> <cfset left = left-(60*minutes)>
> <cfset seconds = int(left)>
> <CFSET pmData = GetMetricData("PERF_MONITOR")>
> <CFSET QueryName="MyQuery">
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html><head><title>Untitled</title></head>
> <body BGCOLOR="#FFFFFF">
> <FONT FACE="Tahoma, Verdana, Arial, Helvetica">
>
> <FONT FACE="Tahoma, Verdana, Arial, Helvetica" SIZE="1">Amount of time
> server has been up since last restart: <CFOUTPUT>
> <FONT COLOR="##800000">#days#</FONT> Day<CFIF #days# GT  
> 1>s<CFELSE><CFIF
> #days# EQ 0>s</CFIF></CFIF>
> , <FONT COLOR="##800000">#hours#</FONT> Hour<CFIF #hours# GT
> 1>s<CFELSE><CFIF #hours# EQ 0>s</CFIF></CFIF>
> , <FONT COLOR="##800000">#minutes#</FONT> Minute<CFIF #minutes# GT
> 1>s<CFELSE><CFIF #minutes# EQ 0>s</CFIF></CFIF>
> , <FONT COLOR="##800000">#seconds#</FONT> Second<CFIF #seconds# GT
> 1>s<CFELSE><CFIF #seconds# EQ 0>s</CFIF></CFIF><HR>
> <HR>
> </FONT>
> <table cellpadding="4">
>       <tr>
>       
> <td>InstanceName</td><td>#pmData.InstanceName#</td><td></td>
>       </tr>
>       <tr>
>               <td>PageHits</td><td>#pmData.PageHits#</td><td></td>
>       </tr>
>       <tr>
>       
> <td><b>ReqQueued</b></td><td><b>#pmData.ReqQueued#</b></td>
>               <td>
>               <table border="0" cellpadding="0" cellspacing="0">
>               <tr>
>                       <td width="#Evaluate('#pmData.ReqQueued#*10')#"
> bgcolor="Blue">&nbsp;</td>
>               </tr>
>               </table>
>               </td>
>       </tr>
>       <tr>
>               <td>DBHits</td><td>#pmData.DBHits#</td><td></td>
>       </tr>
>       <tr>
>       
> <td><b>ReqRunning</b></td><td><b>#pmData.ReqRunning#</b></td>
>               <td>
>               <table border="0" cellpadding="0" cellspacing="0">
>               <tr>
>                       <td width="#Evaluate('#pmData.ReqRunning#*10')#"
> bgcolor="Blue">&nbsp;</td>
>               </tr>
>               </table>
>               </td>
>       </tr>
>       <tr>
>       
> <td>ReqTimedOut</td><td>#pmData.ReqTimedOut#</td><td></td>
>       </tr>
>       <tr>
>               <td>BytesIn</td><td>#pmData.BytesIn#</td><td></td>
>       </tr>
>       <tr>
>               <td>BytesOut</td><td>#pmData.BytesOut#</td><td></td>
>       </tr>
>       <tr>
>       
> <td><b>AvgQueueTime</b></td><td><b>#pmData.AvgQueueTime#</b></td>
>               <td>
>               <table border="0" cellpadding="0" cellspacing="0">
>               <tr>
>                       <td
> width="#Evaluate('#pmData.AvgQueueTime#/20')#"  
> bgcolor="Red">&nbsp;</td>
>               </tr>
>               </table>
>               </td>
>       </tr>
>       <tr>
>       
> <td><b>AvgReqTime</b></td><td><b>#pmData.AvgReqTime#</b></td>
>               <td>
>               <table border="0" cellpadding="0" cellspacing="0">
>               <tr>
>                       <td width="#Evaluate('#pmData.AvgReqTime#/20')#"
> bgcolor="Red">&nbsp;</td>
>               </tr>
>               </table>
>               </td>
>       </tr>
>       <tr>
>       
> <td><b>AvgDBTime</b></td><td><b>#pmData.AvgDBTime#</b></td>
>               <td>
>               <table border="0" cellpadding="0" cellspacing="0">
>               <tr>
>                       <td width="#Evaluate('#pmData.AvgDBTime#/20')#"
> bgcolor="Red">&nbsp;</td>
>               </tr>
>               </table>
>               </td>
>       </tr>
>       <tr>
>               <td>CachePops</td><td>#pmData.CachePops#</td><td></td>
>       </tr>
> </table>
> </DIV>
> </CFOUTPUT>
> </body>
> </html>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to