What is Internet? 12 Major Disadvantages of Using the Internet in Our Daily Lives

The Internet is supposed to be the blast to the tech world. At present, it has affected us much a lot that we can’t envision our lives without the Internet. Many people splash out their quarter time…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to invoke Java Garbage Collection log analysis API?

In this modern world, Garbage collection logs are still analyzed in a tedious & manual mode. i.e. you have to get hold of your Devops engineer who has access to production servers, then he will mail you the application’s GC logs, then you will upload the logs to GC analysis tool, then you have to apply your intelligence to anlayze it. There is no programmatic way to analyze Garbage Collection logs in a proactive manner. Thus to eliminate this hassle, gceasy.io is introducing a RESTful API to analyze garbage collection logs. With one line of code you can get your GC logs analyzed instantly.

Here are few use cases where this API can be extremely useful.

Most of the DevOps invokes a simple Http ping or APM tools to monitor the applications health. This ping is good to detect whether application is alive or not. APM tools are great at informing that application’s CPU spiked up by ‘x%’, memory utilization increased by ‘y%’, response time dropped by ‘z’ milliseconds. It won’t inform what caused the CPU to spike up, what caused memory utilization to increase, what caused the response time to degrade. If you can configure Cron job to capture thread dumps/GC logs on a periodic interval and invoke our REST API, we apply our intelligent patterns & machine learning algorithms to instantly identify the root cause of the problem.

Advantage 1: Whenever these sort of production problem happens, because of the heat of the moment, DevOps team recycles the servers with out capturing the thread dumps and GC logs. You need to capture thread dumps and GC logs at the moment when problem is happening, in order to diagnose the problem. In this new strategy you don’t have to worry about it, because your cron job is capturing thread dumps/GC logs on a periodic intervals and invoking the REST API, all your thread dumps/GC Logs are archived in our servers.

Advantage 2: Unlike APM tools which claims to add less than 3% of overhead, where as in reality it adds multiple folds, beauty of this strategy is: It doesn’t add any overhead (or negligible overhead). Because entire analysis of the thread dumps/GCeasy are done on our servers and not on your production servers..

When you conduct performance tests, you might want to take thread dumps/GC logs on a periodic basis and get it analyzed through the API. In case if thread count goes beyond a threshold or if too many threads are WAITING or if any threads are BLOCKED for a prolonged period or lock isn’t getting released or frequent full GC activities happening or GC pause time exceeds thresholds, it needs to get the visibility right then and there. It should be analyzed before code hits the production. In such circumstance this API will become very handy.

As part of continuous integration it’s highly encouraged to execute performance tests. Thread dumps/GC Logs should be captured and it can be analyzed using the API. If API reports any problems, then build can be failed. In this way, you can catch the performance degradation right during code commit time instead of catching it in performance labs or production.

Invoking Garbage Collection log analysis is very simple:

Assuming your GC log file is located in “./my-app-gc.log,” then CURL command to invoke the API is:

It can’t get any more simpler than that? Isn’t it?

GC log files are quite large in size. For fast and efficient processing, we recommend you to compress and send the GC log files. When you are compressing the GC log, you need to pass ‘Content-Encoding’ element in the HTTP Header element or in the URL parameter.

Say suppose you are compressing GC log file into ‘zip’ format, then you can invoke the API with HTTP header element

or you can also invoke the API with ‘Content-Encoding’ element in the URL parameter

We support following compression formats :

zip, gz, xz, z, lzma, deflate, sz, lz4, zstd, bz2, tar

You may use the one of your choice. Whatever compression format you used for compressing the GC log files should be passed in ‘Content-Encoding’ element.

Note: use the option “–data-binary” in the CURL instead of using “–data” option. In “–data” new line breaks will be not preserved in the request. New Line breaks should be preserved for legitimate parsing.

You can also invoke the API using any webservice client tools such as: SOAP UI, Postman Browser Plugin,…..

Fig: POSTing GC logs through PostMan plugin

Sample Response

Add a comment

Related posts:

Extra Curriculars

As you leave the stage, the thumping of your heart in your ears drowns out the thunderous applause. Months of your life have gone into this presentation, and it could not have gone better. You savor…

12 Tips for Better Foundation Maintenance in Your Home or Business

Even though most foundations are incredibly durable, damage can still happen at any time. Homeowners who aren’t careful might end up struggling with ongoing repairs after they notice cracks…

What Would Oprah Do?

Culture- A culture is a way of life of a group of people — the behaviors, beliefs, values, and symbols that they accept, generally without thinking about them, and that are passed along by…