Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

With Great Availability Comes Great Performance

DZone's Guide to

With Great Availability Comes Great Performance

Measure your application performance and availability to the finest detail with a built-in transaction detection engine.

· Java Zone
Free Resource

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

In this series of posts I am covering some of the many ways you can benefit from XpoLog and especially on how to get the most valuable information about your log4j event logs.

By running Analytic Search on your log4j data, you can among other things measure your application performance and thread activity, measure code activity with class and method analytics on log4j, build security analysis, and create dashboards, charts, slide-shows, and make use of other visualization gadgets for maximum analysis.

In this post I will show you how XpoLog can measure your application performance and availability to the finest detail in just a few lone clicks with a built-in transaction detection engine. To test it for yourself, download XpoLog for free here.

Preliminary

For the sake of our use cases, we selected one of our Java applications which runs various types of processes. This application uses log4j to log its activities. One of these logs is called system audit. System audit notes all the various stages of the different processes executed by the system.

We added the log in XpoLog Manager:

Image title

For the full Add Log procedure, see my post “From log4j to XpoLog”.

Application Performance

Every second, tens, hundreds, and even thousands of transactions are logged in system audit. We want to measure the duration of each transaction and find out how many of them took more than 10 seconds to complete. We want to count how many such “slow” transactions occurred per hour.

On the Search page, in the search field, type:

* IN log.system audit |transaction ("start job", "Thread", "Job Started" -> "end job","Thread","Job Completed") |where transaction time > 10000 |count|interval 1 hour

Where:

  • Transaction is an XpoLog function which maps the system processes in the log and displays a flow of events.

  • Transaction time is measured in milliseconds, so 10000 is 10 seconds.

We got the following result:

Image title

We can tell from the graph that the times when we are likely to experience poorer performance are between 8 AM and 6 PM. The table below the graph lists the number of transactions that lasted more than 10 seconds, per hour.

Let’s say you were to decide that more than 50 occurrences of a transaction taking more than 10 seconds would cause an overall delay. You can easily tell from the results (graph and table) when the times you are most likely to experience poorer application performance are. See the areas marked in red:

Image title

Application Availability

Let’s continue with another system audit use case and check its availability. We want to find out which system processes never completed, and when they took place.

On the Search page, in the search field, type:

* IN log.system audit |transaction ("Set job state to Working Job State", "Thread","Job Started"->"Set job state to Finish Job State","Thread","Job Completed") |where job completed = null

Where:

  • Transaction is an XpoLog function which maps the system processes in the log and displays a flow of events.

  • Null means missing. For this search, “job completed = null”, means that the “Job Completed” step is missing from the flow.

We got the following results:

Image title

We see from the graph when the most occurrences of the transaction failing to complete successfully took place.

The table below the graph lists the times the transaction failed to complete successfully.

In a Nutshell

I have already shown you in my previous post, “Adding Search and Analytics to log4j”, how a search, simple or complex, can give you results far beyond the expected, and how XpoLog is always many steps ahead analyzing your data and suggesting analytic insights you never even thought of could be what’s causing you trouble. But now you have also seen that XpoLog’s search engine has a built-in transaction detection engine, automatically giving you insights regarding the application performance and availability.

In my next post I will show you how XpoLog can give you valuable information regarding your application and code quality. Stay tuned for my next post or go directly to “Getting the Maximum from your log4j logs”.

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:
java

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

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

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}