I have recently been using an app called ATracker to keep track of where I’ve spent my daily time when at work. The end result is in some sense bad because very often I got too busy at work and forgot to start and stop the tick. However, one thing that’s accurate from the logs is my commute time, as these are relatively bigger context switches in the day that I didn’t miss any.
This post strives to figure out the best time of day for me to commute to work. I could as well work out the same for when to come home, but that’s a little irrelevant because there isn’t much traffic at the time that I come home each day (around 6:30pm).
Getting the data
ATracker has the cabability of backing up your data file. If you
purchased the pro version, you’ll be able to export to a CSV, which
will be much more convenient. I don’t have the pro version. All I get
backup.ATracker file what I can send to myself as an
Well, no worries.
First I ran a
file backup.ATracker command, and the file format is
backup.ATracker: Zip archive data, at least v2.0 to
extract. To extract this file, simply run
Three files were extracted:
Locations.sqlite-wal. I wasn’t sure about
the latter two, but it is a sure sign that these are SQLite database
files I need to decrypt next.
A quick Google search lead me to DB Browser for SQLite.app, which is surprisingly simple to install and use. The application provides a simple UI which you can load a SQLite database and also lets you run SQL queries against the database.
A scan through of all the table names, I was able to quickly identify
the “Commute” task that I created in ATracker has a
Z_PK of 6, in the
ZTASK table, whereas all my actual log
entries are in the
ZTASKENTRY table. Simply running a
from ZTASKENTRY where ZTASK = 6 gives me all my log entries for
commute. To make it easier to analyze, I used the following to convert
the dates (and only the dates) to local time:
strftime('%Y-%m-%d %H:%M:%S', datetime(ZSTARTTIME, 'unixepoch',
'localtime')), strftime('%Y-%m-%d %H:%M:%S', datetime(ZENDTIME,
'unixepoch', 'localtime')) from ZTASKENTRY where ZTASK = 6. For some
odd reasons, ATracker records all the timestamp in the year 1985, where as
the month, day, and time are correct. That doesn’t concern me because
my logging only happens in 2016, and I only care about the difference
Analysis and results
(So I obviously was interrupted when writing this post so the analysis part fell short. Once the momentum was gone, it was hard to get back to focus on this.) Below I’ll just summarize some conclusions. They match my experience nicely.
- In the morning, I would see little traffic if I start before 7 A.M. or after 9 A.M. In the evening, coming home before 4 P.M. or after 6 P.M. has much lighter traffic.
- Except when it rains. The traffic is then always bad, because of some accidents on the road.
- Monday and Friday mornings see lighter traffic, while Tuesday, Wednesday, and Thursday see more traffic.
- I5 and I5-Express has similar traffic when there is no traffic. They differ quite a lot when the traffic on one route is bad.