Handy load testing code for Google Cloud Endpoints

Now that my app has been submitted and I am awaiting its review, I have time to work on non-critical things like open-sourcing code that I’ve been working on.

I’ve always been a big user and proponent of open source software and have released open source code in the past, but this will be the first code I’ve released for Cromulent Labs. I hope to provide more useful code to the public in the future.

The first project I am releasing is a custom JMeter log parser which can be used to replay Google Cloud Endpoints requests in order to load test an API.

If you’re not familiar with Google Cloud Endpoints, it is a handy extension to Google AppEngine which allows you to define an API on the server-side and it auto-generates the client code for IOS, Android and Javascript. This makes it very easy to create a Service Oriented Architecture, which is all the rage with the kids these days, without having to write your own custom client code to hit the API on the server.

My custom log parser allows you to easily replay logs from an app session in order to stress/load test your API and see if anything breaks. This can be especially useful before you release your client software because while testing by yourself, you probably always hit the same App Engine frontend instance. By loading up enough concurrent JMeter thread groups, you can simulate many more users and test how well your back-end works with a number of different instances running under load at once.

To use the custom log parser, all you need to do is turn on Cloud Endpoints logging on your client. Then create an Access Log Sampler in JMeter and point it at your Endpoints logs for a session. It goes through each API log in order and automatically sets the same URL endpoint, query string, headers and post body for each API call and replays it to your frontend instance. If you want to try it out, there are more detailed steps in the README file for the project which is hosted here on GitHub:

https://github.com/gregggreg/jmeter-custom-components

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s