Over a million developers have joined DZone.

Caudit : Audit your performance

· Performance Zone

Discover 50 of the latest mobile performance statistics with the Ultimate Guide to Digital Experience Monitoring, brought to you in partnership with Catchpoint.

Performance auditing is an important issue when you deal with an application which requires high performance. As I searched on the web, I could not find a way of doing that, so I have written a performance auditing library called Caudit.

Caudit is a simple library to log application performance, health and statistics in an organized manner. It has two basic audit types: stopwatches and quantities. Stopwatches are the ones which you keep track of the time passed for a specific operation. Quantities are variables that you want to monitor.

In general, I have used stopwatches to monitor my threads and quantities to monitor my queue sizes. Let's give some examples to make it more clear.

An example of a stopwatch.

//Mapping audit to integer is for performance
//(string comparison vs integer comparison)
  private final static int BASIC_STOPWATCH_ID = 

  public void tryOut(){
    final Stopwatch stopwatch = Audits.getBasicStopwatch(BASIC_STOPWATCH_ID);

Output for this stopwach is as follows.

example.basicStopwatch : ElapsedTime[5679]

An example for quantity.

 private final static int NO_OF_RETRIEVED_ITEMS_ID = 

  public void tryOut(){
    final LongQuantity quantity = Audits.
    int size = retrieveItems().size();

Output for this quantity is as follows.

example.noOfRetrievedItems : Quantity[2631]

Dependency for caudit as follows.


What I do with those stopwatches and quantities is to output to audits to the console, log and etc. For more information, please visit https://github.com/Cetsoft/caudit/ and fork me on github.

Is your APM strategy broken? This ebook explores the latest in Gartner research to help you learn how to close the end-user experience gap in APM, brought to you in partnership with Catchpoint.


Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}