Track Your Coding Productivity with WakaTime
Back in June, I wrote an article about Codeivate, which is capable of tracking the language you are currently programming in, awarding points to your virtual profile in a manner similar to an RPG. One of the comments I received on that article was a link to a tool named WakaTime, which has similar capabilities. However, WakaTime is promoted as a time tracker, rather then a tool to measure your coding habits.
WakaTime records several things when you’re using your editor. First it records the absolute path of the file you are working in. This way, you can get a clear view of which files you have been working on in a certain time period. It also records the current time, what triggered the event and the current language syntax for the opened file. Next to that, it also tracks your current project and branch if possible, and the total number of lines for the current file.
These records are either stored locally until you are connected to the internet or on so called heartbeat events. Such a heartbeat is triggered in three different ways:
- Every two minutes if you actively use the editor
- When you switch between files
- When you write something in a file
WakaTime can be integrated into an even bigger range of editors. From text editors like Sublime to IDE’s like XCode and PhpStorm. For this article, we’ll use the same editors as we have used in the Codeivate article: Sublime Text and PhpStorm. If you are interested in how to install WakaTime in any of the other editors, please take a look at this page.
The first thing to do is register yourself on WakaTime. Registration goes easy and smooth and there is no need to activate yourself. Fill in your email address and your password and you’re logged in immediately. WakaTime asks you directly which editor you want to use and you can click on your favorite editor to get started. You’ll need an API key which can be found on this page.
Before you configure Sublime Text, make sure you’ve installed the package control. Open up package control and choose to install a package. Search for
WakaTime and install the appropriate package.
As soon as Sublime is done installing the package, it’ll ask for your WakaTime API key at the bottom of your screen. After pressing enter, your Sublime editor has been configured.
Open PhpStorm and click
preferences. Within preferences, go to the plugin section and click
browse repositories. Search for
WakaTime and install the plugin that appears. When installed, PhpStorm will ask you to restart. Upon re-opening the app, a pop-up will appear and ask you for the API key of WakaTime. Fill in the API key you copied from the page above and paste it in the box. After you press enter, your PhpStorm editor has been configured.
As soon as you change some files within your editor, you’ll notice on the WakaTime website that it’s recording your progress and logging data.
I already mentioned that WakaTime is more of a time tracking tool then a tool to track your coding habits. As we’ve seen, WakaTime also tracks your project name. This way it’s capable of tracking how much time you are spending on a certain project within your editor. It can even track how much time you spent on each file.
Next to the time spent on a project, you can also see how much time you spent using a certain programming language. Clicking on a programming language will reveal which files you’ve changed. It’s nice to know how much time you spent on certain files, so you can roughly guess how much time it took to implement a certain feature, for example.
Comparing with Codeivate
WakaTime is more of a professional tool to track the time you’re spending on a certain project, with language tracking capabilities. Codeivate is more of a tool to track your languages, with some social elements added to it, like a leaderboard and ‘battles’.
This difference is reflected in the price: WakaTime costs you US $9 a month if you want to keep your history. If you stick to the free plan, your history will only last for seven days. Codeivate, on the other hand, is free to use.
WakaTime’s website is easier to understand and has a much better UX. The installation of the plugin itself is much easier then the one for Codeivate. However, in PhpStorm for example, you can see your actual status of Codeivate, while for WakaTime, you’ll need to open it’s website.
So if you’re more into the social aspect and you just want to roughly track which languages you’re using, Codeivate is what you’re looking for. If you want to track how much time you are spending on projects, WakaTime is definitely the way to go.
Comparing with Toggl
Since WakaTime is more like a time tracker tool, it’s only fair to compare it with another time tracking service. Since we have a nice list of time trackers already covered in an other article, I decided to go with a different one named Toggl.
Toggl is more like a web based tool, because you do most of your work within your browser. Toggl is very easy to use. You just open it up in your favorite browser, pick a project and click the ‘start’ button. A timer starts to run and you can start working on the project. When you are finished, hit the stop button and the time you spent is recorded.
This is a fairly common process you will see in most time trackers. The advantage of this is that it also calculates the time you spent on answering emails, calling clients or testing your web application. In WakaTime, that time would be unrecorded. But an advantage of WakaTime is that, if you suddenly switch to a different project, it’ll automatically register time spent on that project, while with Toggl, you’ll have to stop recording and start a new session.
Toggl also allows you to add time manually, in case you forgot to click the start button or you were not near your computer.
I do like the idea behind WakaTime, but I see a problem as I already outlined in my comparison with Toggl: There is more time spent on a project then just the part where you work with the editor. You might have to plan visits or calls, you might need to send emails or test the application. WakaTime isn’t capable of tracking this time and there is no way to manually add some extra time. So in the end, you’ll still need to find another time tracker to track these tasks. I think if WakaTime could resolve this issue, the tool would be more usable. For me, however, I prefer the way Toggl works since I can track everything. At first, you might need to get used to it, but when it’s in your system, you’re recording everything.
What tools do you use to measure your coding productivity? Have you tried WakaTime or one of the other popular tools, and do you have any tips?