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

Using XRebel With Couchbase

DZone's Guide to

Using XRebel With Couchbase

XRebel can integrate with Couchbase to give you a comprehensive overview of all the calls made to your backend each time you send a request to the server.

· Performance Zone
Free Resource

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

I recently was in Tallinn for a conference called TopConf and for a local Docker meetup. You might think that this doesn’t have much to do with the title of this post, but actually, it does. Tallinn is also where you’ll find ZeroTurnaround’s HQ. ZeroTurnaround being the company behind XRebel. I tweeted I was there, Simon Maple saw it, and he invited me to a tour of their local office. I can now invite you to a tour of the XRebel and Couchbase integration.

What’s XRebel?

It’s a performance tool for Java Web Apps. From their website:

Use real time performance insights to understand and resolve potential issues faster and earlier during the development phase. Master your business applications to reduce rework, minimize technical debt, and improve end-user experience.

It integrates with various message queues and databases, one of the latest being Couchbase. It gives you a comprehensive overview of all the calls made to your backend each time you send a request to the server.

How Do I Try This?

Just go on the ZeroTurnaround website and download the latest version do XRebel. Unpack it and make sure you remember where, as you will need its location. It works more or less automatically because it’s a Java agent. Each time you run a Java process, you need to declare the path to that agent in the JVM configuration. If you are launching your app by using java it would like this:

java -jar -javaagent:[path/to/]xrebel.jar myApp.jar

Or if like me you are using Maven and a Spring Boot application:

mvn spring-boot:run -Drun.agent="[path/to/]xrebel.jar"

If the agent was picked up right, you should see the following message logs:

XRebel: Starting logging to file: /home/ldoguin/.xrebel/xrebel.log
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel: ################################################################
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel:  This product is licensed to Laurent Doguin (Couchbase)
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel:  License type: trial
2016-11-29 16:00:42 XRebel:  Valid from: November 17, 2016
2016-11-29 16:00:42 XRebel:  Valid until: December 1, 2016
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel: ****************************************************************
2016-11-29 16:00:42 XRebel:          Your license is about to EXPIRE!
2016-11-29 16:00:42 XRebel: ****************************************************************
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel:  This license will expire in 3 days and XRebel will
2016-11-29 16:00:42 XRebel:  stop working after that. Renew your license at:
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel:     http://zeroturnaround.com/software/xrebel/buy
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel: ################################################################
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel: ################################################################
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel:  XRebel 3.1.6-DEV-SNAPSHOT (201611171352)
2016-11-29 16:00:42 XRebel:  (c) Copyright ZeroTurnaround AS, Estonia, Tallinn.
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel:  For questions and support, contact xrebel@zeroturnaround.com
2016-11-29 16:00:42 XRebel:
2016-11-29 16:00:42 XRebel: ################################################################
2016-11-29 16:00:42 XRebel:

Now, XRebel will hook itself to a servlet you have running and start injecting some HTML code automatically so you can access their dashboard. Here’s an example using an application I did for a previous blog post:

As you can see, XRebel gives you a good indication of what is going on for each call you make. You can see the whole stack trace and the details of each Couchbase operations you do, whether it is Key/Value, an N1QL query, or a full-text search.

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

Topics:
couchbase ,performance ,xrebel

Published at DZone with permission of Laurent Doguin, DZone MVB. See the original article here.

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