Code Kata is a term coined by Dave Thomas, co-author of the book The Pragmatic Programmer, in a nod to the Japanese concept of kata in the martial arts. A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition.
The goal of this Kata is to get your mind wired into performance driven development, to reinforce your skills as a user of New Relic.
Of course the code in some areas of this application is intentionally bad, but what fun would this be if everything worked the way it should?
Create a virtualenv and install the dependencies.
$ cd newrelic-python-kata
$ python virtualenv.py venv
$ source venv/bin/activate
$ pip install -r requirements.txt
Install Newrelic agent.
$ pip install newrelic
Get the license key from the right side-bar on this page and generate the config file.
$ newrelic-admin generate-config <license> newrelic.ini
Edit the file to suit your needs. (Set transaction_tracer.transaction_threshold to 0.2)
Set the NEW_RELIC_CONFIG_FILE environment variable.
$ export NEW_RELIC_CONFIG_FILE=newrelic.ini
Initialize the database.
$ python initialize_db.py
Deploy the app.
$ newrelic-admin run-python manage.py run_gunicorn
Fix the code / Solve as many of the Katas as you can. There are four distinct Katas in this application (check the top bar) each with some hints on their respective pages.
Let us know how you did, what you liked or disliked, what helped you find problems or what were the challenges, what you like about New Relic and what you don't - we just want to hear from you and see what we can do to get better.
We'll even send you something for demonstrating your geek super powers when you complete the Kata - just provide us with your thoughts and a link to your forked repo (with your answers).