Forum Discussion

slecault's avatar
slecault
Contributor
10 years ago

aqPerformance questions

I have recently discovered the aqPerformance counter. I have questions:

 

I was running version 10.60 and never saw this feature before.  I recently installed TC11 and added the WEB module.

a) Is this new with version 11?

b) Is there a way to reset the counter without generating a warning message?

c) I had to read the online documentation in order to confirm that the ".start" method resets the counter if called on an already started counter.

 

Thanks

  • SmartBearDan's avatar
    SmartBearDan
    SmartBear Alumni (Retired)

    Hello slecault,

     

    There were some enhancements with TestComplete 11 to make performance checking easier.  A simple example is included below.  It starts a counter, takes some actions in my application, gets the current value of that counter, then logs it.  It sounds like you've been using the same counter and resetting it as needed, another option is to create different counters at different times.  For example, in the screenshot below the counter is named "Login", and I could add additional counters to the test as needed if I need to track different pieces.

     

    StopwatchExample.png

     

    If you're using these counters to check the performance of your application doing a set of steps, another option to consider is the performance Group Check.  The Group Check operation checks the execution time of a set of child operations with a specified maximum execution time. If the execution time is greater than the specified maximum execution time, the operation posts an error message.

     

    StopwatchExamplegroup check.png

     

     

    Performance Category (for keyword tests)https://support.smartbear.com/viewarticle/71719/

    aqPerformance Object (to use in script): https://support.smartbear.com/viewarticle/73812/

    • slecault's avatar
      slecault
      Contributor

      Regarding your reply, I conclude this is a new feature of TC11. The start/reset always log a warning. 

       

      My objective was to write the execution time of each of our scnenarios (both keywords and scripts) by doing the following:

       

      GeneralEvents_OnStartTest

       

             aqPerformance.Start('DefaultCounter')

       

      GeneralEvents_OnStopTest

             Log.Message(aqPerformance.Value);  (Eventually, write this result in a seperate file for further comparison)

       

       

      Because of the warning message on "reset", all of my 550 test items end up in warning instead of success.

      I am using an other method to achieve my objective using the a project variable.

       

      GeneralEvents_OnStartTest

      project.Variables.MyStartTime := aqDateTime.Time ;

       

      GeneralEvents_OnStopTest

      aqConvert.TimeIntervalToStr(aqDateTime.TimeInterval(Project.Variables.MyStartTime,aqDateTime.Time ))