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

Use Jenkins to List the Slowest Steps in Deployment

DZone's Guide to

Use Jenkins to List the Slowest Steps in Deployment

Using Jenkins, we can figure out which part of the deployment pipeline is keeping us down.

· DevOps Zone
Free Resource

Download “The DevOps Journey - From Waterfall to Continuous Delivery” to learn learn about the importance of integrating automated testing into the DevOps workflow, brought to you in partnership with Sauce Labs.

System deployments and upgrades usually need to perform many actions. If we can detect and improve time-consuming steps, we will get better customer satisfaction or a shorter maintenance time window. However, when tons of steps are involved, how we can easily examine and figure out the bottleneck?


slow_steps.png

Permanent Link: http://dennyzhang.com/list_slowest_steps

You may think, if we can make sure all critical actions log messages use the same timestamp format, we could get the time elapsed for each step.

The answer is Yes and No. Usually deployment may run automation scripts of several components or modules. e.g some are in bash, some in Chef/Puppet/Ansbile, some in Python, etc. It's hard to enforce the practice, especially for the timestamp format convention. The good thing is that every professional tool and engineer will do effective logging for all critical actions, if not all. So the missing part here is how to attach the unified timestamp.

Fortunately Jenkins has a useful plugin called Timestamper. It can add timestamps to the Console Output of Jenkins jobs.

jenkins_timestamper_plugin.png

Here is the idea:

  1. Automate deployment procedure as a bash script and run it as a Jenkins job.
  2. Enable Jenkins Timestamper plugin properly for this Jenkins job.
  3. Caculate time performance of each step by parsing the Jenkins Console Output line by line.
  4. Sort steps by time performance with a descending order.

For better user experience, I've defined a Jenkins job: DiagnosticJenkinsJobSlow. Below is a real example of how it works.

DiagnosticJenkinsJobSlow1.png


DiagnosticJenkinsJobSlow2.png

Like our blog posts? Discuss with us on LinkedIn, Wechat, or our Newsletter.

Discover how to optimize your DevOps workflows with our cloud-based automated testing infrastructure, brought to you in partnership with Sauce Labs

Topics:
devops ,performance

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 }}