← Home | HN discussion

Thyme: a simple CLI to measure human time and focus

2016.08.15

It’s like a CPU profiler, but for your productivity rather than your machine’s

Do you ever think about how to make yourself a more productive programmer? At Sourcegraph, this is a question we think about every day. Our entire mission is to make your life as a developer easier and more efficient.

Thyme is a sampling profiler for your productivity

Thyme is a sampling profiler for your productivity.

Programmers seek out and use tools that we think will help us squeeze the most out of every minute of every hour of every day—but how well do these tools actually work? We need answers to questions like:

Time-tracking programs are a dime a dozen, but when we looked around, we didn’t find any that we’d want to use day-to-day as developers. Existing trackers made you manually enter information, use a clunky GUI, or didn’t let you drill down into the data. We wanted a time-tracking utility that had all the things you’d expect from a great developer tool: a simple and easy CLI, full control and access to the raw data, and source code that’s hackable and open.

So we wrote Thyme, an open source command-line tool that lets you easily track and analyze the time you spend on your computer. Think of it as a sampling profiler, but for You instead of your machine.

Finding actionable productivity insights with Thyme

Thyme tracks which applications you use over time and then helps you explore the data to find actionable insights to boost your productivity. Here’s how I used it for this very purpose—as I was writing it.

Thyme was written in 2 parts. Part 1, which tracks application usage, was written first. Part 2 displays pretty charts, and was written the day after. Because I had the tracking code working before I wrote the charting logic, I was able to use Thyme to track my app usage as I wrote part 2. Here’s what I found.

Chart 1: Application usage timeline

This first chart shows application usage over the course of the afternoon, from 4pm to 8pm. On the chart, you can see that I had open 3 distinct applications: Google Chrome, Slack, and “beyang@claude~”. The last one is my terminal where I run Emacs (my computer’s name is “claude”—long story). Thyme splits the timeline into 3 rows:

Thyme's timeline of application usage

Observations:

Chart 2: Detailed application usage breakdown

This second chart breaks down the timeline of application usage by window name. You can see what I was viewing in each application.

Thyme-line of application windows

Observations:

Chart 3: Which apps do you rely on overall?

Aggregate breakdown of which applications were most used, most visible, and most open

This third chart shows an aggregate overview of which applications I used during my afternoon coding session. The interesting thing to note here is the differences in relative order between “open”, “visible”, and “active” applications. I had Slack open the whole time, but I basically never used it. Chrome was by far the most visible, because I was using it frequently to look up documentation and usage examples and test out the Thyme dashboard. But the application that I actually used the most was my terminal, which contained my editor.

Takeaways

Here are some concrete, actionable takeaways I took from diving into this data:

Thyme yourself

If you’re interested in using Thyme to investigate your own productivity, you can install Thyme here. It’s a single command line tool with 2 simple parts: a time tracker and a data visualizer.

The Thyme tracker snapshots all open windows on your computer at a a given point in time. You can have it output this information to a file. It’s like a sampling profiler, but instead of CPU time and processes, it looks at human time and open application windows. You can make it run every 30 seconds like this:

$ watch -n 30 thyme track -o thyme.json

The Thyme data explorer reads data from the tracker output file and shows a single page with interactive charts. You run it with a single command, too:

$ thyme show -i thyme.json -w stats > thyme.html

Then just open thyme.html in your favorite web browser and voila, you get the pretty charts you see above.

All the information Thyme collects is kept safely on your local disk so you have full control over your data. It never sends any information over the Internet.

Thyme currently supports Linux (with X-Windows) and macOS support is on the way soon. It’s built with simplicity and hackability in mind. The code is open source, well-documented, and easily extensible. Try it out and let us know what you think!


This post was originally published at sourcegraph.com/blog/thyme-a-simple-cli-to-measure-human-time-and-focus