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.
早在六月,我写了一篇关于Codeivate的文章 ,该文章能够跟踪您当前正在使用的语言,并以类似于RPG的方式将分数授予您的虚拟配置文件。 我收到该文章的评论之一是指向名为WakaTime的工具的链接,该工具具有类似的功能。 但是,WakaTime被提升为时间跟踪器,而不是用来衡量您的编码习惯的工具。
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.
使用编辑器时,WakaTime会记录一些内容。 首先,它记录了您正在处理的文件的绝对路径。通过这种方式,您可以清楚地了解在特定时间段内正在处理哪些文件。 它还记录当前时间,触发事件的原因以及打开文件的当前语言语法。 紧接着,它还会跟踪您当前的项目和分支(如果可能),以及当前文件的总行数。
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:
这些记录或者存储在本地,直到您连接到Internet为止,或者存储在所谓的心跳事件中 。 这种心跳是通过三种不同的方式触发的:
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.
WakaTime可以集成到更大范围的编辑器中。 从诸如Sublime之类的文本编辑器到诸如XCode和PhpStorm之类的IDE。 对于本文,我们将使用与Codeivate文章相同的编辑器:Sublime Text和PhpStorm。 如果您对如何在其他任何编辑器中安装WakaTime感兴趣,请访问此页面 。
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.
首先要做的是在WakaTime上注册自己。 注册变得轻松顺畅,无需激活自己。 填写您的电子邮件地址和密码,您将立即登录。 WakaTime直接询问您要使用哪个编辑器,您可以单击自己喜欢的编辑器开始使用。 您需要可以在此页面上找到的API密钥。
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.
在配置Sublime Text之前,请确保已安装软件包控件 。 打开程序包控件,然后选择安装程序包。 搜索WakaTime并安装适当的软件包。
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.
Sublime安装完程序包后,它将在屏幕底部要求您的WakaTime API密钥。 按回车后,您的Sublime编辑器已配置完毕。
Open PhpStorm and click file -> 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.
打开PhpStorm并单击file -> preferences 。 在首选项中,转到“插件”部分,然后单击“ browse repositories 。 搜索WakaTime并安装出现的插件。 安装后,PhpStorm将要求您重新启动。 重新打开该应用程序后,将出现一个弹出窗口,询问您WakaTime的API密钥。 填写从上一页复制的API密钥,然后将其粘贴到框中。 按Enter键后,您的PhpStorm编辑器已配置完毕。
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.
一旦在编辑器中更改了一些文件,您就会在WakaTime网站上注意到它正在记录您的进度并记录数据。
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.
我已经提到WakaTime不仅仅是一个时间跟踪工具,而是一个跟踪您的编码习惯的工具。 如我们所见,WakaTime还跟踪您的项目名称。 这样,它就可以跟踪您在编辑器中花费在某个项目上的时间。 它甚至可以跟踪您在每个文件上花费了多少时间。
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.
除了在项目上花费的时间,您还可以查看使用某种编程语言所花费的时间。 单击一种编程语言将显示您已更改的文件。 很高兴知道您在某些文件上花费了多少时间,因此,例如,您可以粗略地估算实现某个功能所花费的时间。
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’.
WakaTime具有语言跟踪功能,它更是一种用于跟踪您在某个项目上花费的时间的专业工具。 Codeivate不仅是一种跟踪语言的工具,还添加了一些社交元素,例如排行榜和“战斗”。
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每月需要花费$ 9。 如果您坚持免费计划,那么您的历史记录将只持续7天。 另一方面,可免费使用Codeivate。
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.
WakaTime的网站更易于理解,用户体验也更好。 插件本身的安装比Codeivate的安装容易得多。 但是,例如在PhpStorm中,您可以看到Codeivate的实际状态,而对于WakaTime,则需要打开其网站。
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.
因此,如果您更喜欢社交方面的内容,并且只想大致跟踪所使用的语言,则可以使用Codeivate。 如果您想跟踪花费在项目上的时间,WakaTime绝对是您的最佳选择。
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.
由于WakaTime更像是一个时间跟踪器工具,因此将其与其他时间跟踪服务进行比较是公平的。 由于我们已经在另一篇文章中介绍了不错的时间跟踪器列表,因此我决定使用另一个名为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.
Toggl更像是一个基于Web的工具,因为您可以在浏览器中完成大部分工作。 Toggl非常易于使用。 您只需在喜欢的浏览器中打开它,选择一个项目,然后单击“开始”按钮即可。 计时器开始运行,您可以开始在项目上工作。 完成后,请按“停止”按钮,并记录您花费的时间。
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.
在大多数时间跟踪器中,这是一个相当常见的过程。 这样做的好处是它还可以计算您在答复电子邮件,致电客户或测试Web应用程序上花费的时间。 在WakaTime中,该时间不会被记录。 但是WakaTime的优点是,如果您突然切换到另一个项目,它将自动记录在该项目上花费的时间,而使用Toggl,则必须停止录制并开始新的会话。
Toggl also allows you to add time manually, in case you forgot to click the start button or you were not near your computer.
Toggl还允许您手动添加时间,以防忘记单击“开始”按钮或者不在计算机旁边。
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.
我很喜欢WakaTime背后的想法,但是在与Toggl的比较中已经概述了一个问题:在项目上花费的时间比在编辑器上工作的时间更多。 您可能需要计划访问或致电,您可能需要发送电子邮件或测试应用程序。 WakaTime无法跟踪此时间,因此无法手动添加一些额外时间。 因此,最后,您仍然需要找到另一个时间跟踪器来跟踪这些任务。 我认为,如果WakaTime可以解决此问题,则该工具将更有用。 但是,对我来说,我更喜欢Toggl的工作方式,因为我可以跟踪所有内容。 首先,您可能需要习惯它,但是当它在您的系统中时,您正在记录所有内容。
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?
您使用什么工具来衡量编码效率? 您是否尝试过WakaTime或其他流行工具之一,并且有任何提示?
翻译自: https://www.sitepoint.com/track-coding-productivity-wakatime/
wakatime
相关资源:APP通用接口wakatime.zip