By Brian Manley

Recently at CommerceHub, we have been putting more focus on getting reliable performance metrics for our applications.  We’ve found that the best way to do this without using production data, is to run performance tests.

My team specifically wanted to test a REST API with a few high traffic end points. The tool we decided to use was Gatling. Gatling is a load testing tool written in Scala which uses Akka to create a large number of users to fire requests at a target URL. We chose Gatling because it’s easy to set up and it produces very detailed reports.

Now that we had chosen our tool, we needed to figure out how to run our tests. We wanted to execute the tests, and be able to fail a build based on bad results. Our team uses Gradle as a build system so naturally our first instinct was to Google “gatling gradle plugin”. Unfortunately, we didn’t find anything that quite met our needs.

Seeing a need for executing Gatling tests through Gradle, we created our Gatling Gradle Plugin. This plugin allows us to publish our test results to Graphite, run multiple tests in a row, and fail if our application slowed down too much or is returning unexpected responses. We’ve employed the plugin in one of our Continuous Delivery pipelines to ensure that we aren’t releasing changes that greatly slow down our application. This plugin is now available in the CommerceHub OSS git repo.

Categories Software EngineeringTags , , ,
By David Carr

Universally unique identifiers (UUIDs) are useful in various situations, especially in distributed computing, to identify information without central coordination. They have been standardized under RFC 4122, and can be accessed in Java using java.util.UUID.

Globally unique identifiers (GUIDs) are a subset of UUIDs. Microsoft uses them for identifying classes, interfaces, and other objects. In particular, I was interested in the objectGUID attribute for users in Active Directory, though the same technique should apply for all Microsoft GUIDs. Microsoft GUIDs are completely compatible with the UUID specification, with one exception: the binary encoding. In particular, RFC 4122 specifies that all segments must be encoded as big-endian, while Microsoft encodes the first 3 segments using the system’s native endianness (which for Windows is commonly little-endian).

If you’re getting access to the GUID as binary data (such as a byte array), you’ll need to do some processing before passing the data to the UUID class.  Balazs Zagyvai‘s adsync4j project provides a useful example of this (see gist below).  It also uses UnboundID LDAP SDK for Java, which I highly recommend if you’re accessing LDAP servers (including Active Directory) in Java.

Categories Software EngineeringTags , , , ,