Tuesday, September 11, 2012

Is there a way to suppress errors from perfmon counters in controller

Problem Statement: During our day to day life as performance testers / experts, we must have noticed a lot of errors related to counters during a long running scenario. Mostly the errors are like "A counter with a negative denominator value was detected.", "A counter with a negative time base value was detected." or "A counter with a negative value was detected."

All these errors make the online monitoring a lot difficult to filter out the actual errors coming from the application.

Is there a way to mask these errors related to counters?

SolutionThe answer is Yes, it is possible to do so.
For this you need to do the below change in both Controller and Load Generator machine.


  • Go to the Loadrunner (or performance center host) installation dir; then go to folder "dat -> monitors" 
  • under that folder open the file "nt.cfg" in a wordpad; it will be like as shown in the snapshot below:




  • You can see the "general" section in the file, there is an entry called as "FilterErrors" which has the current value as 6.
  • Now to set the proper value for other errors which you want to suppress, get the Hexa value of the error from MSDN website: " http://msdn.microsoft.com/en-us/library/aa373046(v=VS.85).aspx "
  • Look for the hexa code like " 0x800007D6 (PDH_CALC_NEGATIVE_DENOMINATOR) " for the error " A counter with a negative denominator value was detected. "
  • Open Calculator in scientific mode (in case of XP / win 2003 machine) or programmer mode (in case of win 7 or 2008 server) as shown below


  • Move it to Hex mode and make the entry for the Hex code as it appears for the particular error, in this example it will be "800007D6". Once entered, change the calculator to Dec mode and you will get a number like "2147485654" (see the screenshot below):

  • Copy the value from the calculator and put it in the "nt.cfg" file along with the earlier value separated by comma (,) as shown in the screenshot below:

  • Once done you can perform similar steps for other error types you are getting from windows perfmon counters.
  • Save the "nt.cfg" file and restart the loadrunner agent process (or service) on Load generator.



No comments:

Post a Comment