DZone
Performance Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Performance Zone > Caudit : Audit your performance

Caudit : Audit your performance

Yusuf Aytaş user avatar by
Yusuf Aytaş
·
May. 16, 13 · Performance Zone · Interview
Like (0)
Save
Tweet
3.82K Views

Join the DZone community and get the full member experience.

Join For Free

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 = 
	Audits.mapAudit("example.basicStopwatch");

  public void tryOut(){
    final Stopwatch stopwatch = Audits.getBasicStopwatch(BASIC_STOPWATCH_ID);
    stopwatch.start();
    doSomeWork();
    stopwatch.stop();
  }

Output for this stopwach is as follows.

example.basicStopwatch : ElapsedTime[5679]

An example for quantity.

 private final static int NO_OF_RETRIEVED_ITEMS_ID = 
	Audits.mapAudit("example.noOfRetrievedItems");

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

Output for this quantity is as follows.

example.noOfRetrievedItems : Quantity[2631]

Dependency for caudit as follows.

<dependency>
  <groupId>com.cetsoft</groupId>
  <artifactId>caudit</artifactId>
  <version>0.0.7</version>
</dependency>

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.



application Monitor (synchronization) Library Console (video game CLI) Dependency GitHub Clear (Unix) Health (Apple) Statistics

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 50 Common Java Errors and How to Avoid Them
  • 5 Options for Deploying Microservices
  • Geo What? A Quick Introduction to Geo-Distributed Apps
  • Auth0 (Okta) vs. Cognito

Comments

Performance Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo