27% of our app was dead code.
Nobody realised for 5 years.
Until, with help from the logs, I did some analysis.
Observability is about understanding how your app behaves in production.
This is a huge benefit, as anyone who has experienced an app that's well set up for this will tell you.
But there are related benefits that go unsung.
In our case, analysis of dead code was one of them.
27% dead. What did that mean?
* 27% of the test suite was wasted time
* 27% wasted slug size in Heroku
* 27% slower upload time for the app bundle
* 27% more code to grep through
And a bunch of other benefits I'm sure you can imagine.
How did I figure this out in 2 hours?
(I was using Rails, YMMV)
1. List out all the routes
2. Search the logs for HTTP requests in the last 90 days
3. Aggregate by controller and action
4. Download the dataset in CSV
5. Compare the two lists
6. Any route that was in the app but never hit is dead
Want to be able to ask these questions of your app in minutes?
Download the playbook
I'm putting together a playbook on how to achieve this in Rails.
Want to take an early sneak peek?