As an ultra runner, I am really into the mountains. As a software engineer, I’m really into data. So naturally, I’m interested in the intersection of both.
I’ve particularly been interested in how systems like Strava work, especially when they quantify what is known as a “Suffer Score”, a single number denoting the amount of training stress (a.k.a. suffering) you put yourself through in a workout.
How does a track workout compare to a long day on the trails? Which is tougher: a 5m tempo road run in and around my neighborhood, or a tough 2m climb into a local regional park?
I first attacked the problem of getting data off of my phone. I record my GPX tracks in Runmeter, a fantastic iPhone application with all sorts of metrics and data export capabilities. What I wanted was a seamless way to get the data off my phone without fuss after a hard workout.
The application has a nifty feature in which it can automatically send an email to an email address after a workout is completed.
curls and downloads the GPX link embedded in the email.
- Saves the GPX file to a linked Dropbox account.
- Republishes the GPX file to a linked Strava account.
Deriving the Training Stress Score
Next up: I wanted to do a quick and dirty implementation of the (run-based) Training Stress Score. Stressfactor, a Ruby gem, is what came out of it.
It implements the rTSS as detailed in this article.
Stressfactor is a higher-order tookit for deriving meaning from GPX tracks, so it, at the moment, attempts to calculate the stress score and grade adjusted pace.
The data still needs validation, so I’m eager to run it on my data set of GPX tracks from the past years.
I’m working on this part right now — I need to nicely display a report from my workout history in Dropbox and display per-GPX. I’ve started the project — Stressreport.
Some things I’ve learned and am learning
- The human body is complex, and cannot be easily modeled without sufficient data. That said, what I’m doing now may be sufficient for basic training data.
- The nature of parsing and generating higher-order stats from raw data may lend itself well to experimentation with functional languages. I’m interested in trying to reimplement Stressfactor in Scala, or a functional equivalent.
- Deploying all my apps on Heroku’s free tier may actually be an interesting start to building a microservice architecture — with the space limitations on Heroku, I’m forced to build new features on new services. Call it cheapskate architecture.