Training.Slowtwitch.Com: A Primer

In January, 2006, to comply with a New Yearís resolution to perform at least 15 minutes of exercise daily, and to log that exercise, I started the exercise log program. Itís evolved a lot over the years, and Iíve used it to answer increasingly complex questions about my training. The feature set has been growing as Iíve been inspired and as Iíve had free time, and also as better and faster technology became available.

The core of the training log is acquiring and curating an accurate dataset. Iíve written most of my tools around getting that goal reached as quickly and conveniently as possible. Reporting has lagged behind (both from a tools perspective: there are 40+ javascript charting and graphing libraries out there, and Iíve tried 4 or 5 already, and from a time perspective. Good reporting takes a lot of work), and really whatís been lacking is community input and feedback.

For the first 10 years of its existence, the Exercise Log served a total of four regular users, of which two remain: myself and my brother. Jumping from that to over 7,000 active users (meaning, youíve logged a workout in the last couple of years), and a workout database size of just over a million records (versus the ~4,500 I and the fabulous four had logged in a decade) has presented a number of interesting challenges. Itís revealed shortcomings in the code, glitches in the database, and numerous opportunities for updates, new features, and things that had crossed my mind but never made the hot list.

The core of the log has always been the main page. Here is what it looks like at the moment:

The main screen has the following major features:

  • A recent weeks display showing an at-a-glance calendar view with weekly totals by sport
  • A summary of currently active challenges including a top 5 leaderboard for each active challenge, which links to the full challenge leaderboard
  • A personal year to date summary including your year-to-date totals by sport and which links to the year-to-date reporting page, scrollable by year
  • A data quality section, which has several plugins that search out workouts where distance or linked equipment is missing. Additional planned metrics include missing fields, dates in the future, and incorrect or impossible distances


Exercise Log

The Log page comprises several different ways to get at your data, including a full list of all workouts, an alternative (and more mobile-friendly) list, a calendar view, and the reporting page. The main log page has the following features:

  • Filter by description
  • Show Title & Description
  • Sort by date, time, distance, calories, max hr, avg hr
  • Summarize gear used
  • Totals and paging


Calendar

The Calendar page has a month-at-a-glance view of your workouts, with links to workouts, mouseover week totals, monthly totals, and a link to navigate between months (full navigation and filtering is coming soon).

Workout Add/Edit screen
This is how you get data into the system. You can

  • Update fields
  • View average speed/pace
  • Select from available equipment
  • View activity-specific fields
  • Flexibly pick units for distance and ascent/descent

Reports

On the reporting side, it's:

  • Currently year totals only


Gear tracking

Gear tracking tools currently allow you to:

  • Display in table
  • Sort by description, year, brand, model, purchased date, retired date,
  • price, size, color
  • Edit screen allows selection of activities for which equipment is available
  • Displays total miles on equipment

Activity reporting

  • Sort by description, type, group
  • Display total count, distance, & time for each activity


Weight tracking

The weight tracking module:

  • Tracks date, time, weight, bodyfat %, and notes
  • Graphs and arbitrary units selection coming soon

Issues Fixed in December 2016

  • Sync from polar is messing up distances
  • Swimming doesn't appear in exercise list description of activity
  • Add a workout messes up am/pm in javascript
  • Need Ads
  • Aerobic point leaderboard
  • Distance into meters project: add backup column, apply conversion, apply display conversion, update edit box logic, done
  • Imperial/Metric option a little wonky
  • Reconvert data
  • Power13 gone from challenge screen
  • Seconds display on log
  • Duration needs seconds field -- added real_duration field
  • Add open water swimming
  • Aerobic point calculation in workout
  • Suggestion SQL: select e.id, e.distance, e.duration, e.activity, e.aerobic_points, a.aerobic_point_factor, round(e.distance * a.aerobic_point_factor * 100)/100 from exercises e join activity a on e.activity = a.id where aerobic_points is null limit 10;
  • Distances are messed up for swims, tigerchik and mine at at minimum
  • Finish converting other active challenges
  • Need algorithms for all of them - nearly complete
  • Update run challenge with secondary sort (distance second after count)
  • Continue to update distance displays to show correctly based on distance type / user's units field
  • Aerobic points wrong for swimming
  • Note about control-clicking on equipment form
  • Aggregate distance on YTD not very helpful: add overall aerobic points


Fixed in January 2017
  • Challenges on home screen shows old ones -- moved to Challenges page only
  • Exercise Edit box doesn't load in IE 11 -- Math.trunc doesn't work in IE, derp, switched to Math.floor
  • Add challenge: Swim 4x/week in January (by frequency) for tigerchik
  • Check 100/100 for Dev: snowshoe runs not coming in?
  • Need Leaderboard of top 5 people, last 7 days, each activity, swim, bike, run
  • Tony.White username change!
  • BUG: Distance type is not taking default per activity after activity change
  • BUG: Aerobic points are not changing calculation based on activity change on edit screen
  • Add to leaderboard of top 5 people, last 7 days: ranking of current user if logged in
  • RayP 4 swims got distance 0'd, dec 26, 27, 28, 29, then he reset, check it out
  • Show aerobic point factor on activity screen
  • Update challenge leaderboard to show current user's row differently
  • Update challenges so they don't go away immediately after they end (close date vs end date or something??)
  • Gear page distance is foozed -- needs the new distance display!
  • Swim year totals are not in meters / yards but instead miles / kilometers
  • BUG: description filter causes slow query
  • Fix tab order on edit workout screen - don't tab through spinners!!
  • Activity specific fields
  • Add average speed / average pace for all applicable workouts
  • Add "ascent" and "ascent_distance_type" fields: added to DB but not edit screen - not for swimming, obiviously
  • Cycling-specific fields like power, cadence should be shown only on cycling group activities
  • Add cycling-specific average speed
  • Add running-specific fields, such as "average pace, max pace, fastest mile/km"
  • Add swimming-specific fields, such as "average pace/100, max pace/100"
  • Fix euro comma/decimal point display with metric units
  • Body weight tracking is needed
  • Convert body weight entries!
  • Convert weights: insert into weight select null, user.id, ugw.weight_date, null, ugw.weight, null, null, null, null, case when ugw.source is not null then concat('Source: ', ugw.source) else null end from ugomo_user_weight ugw inner join user on ugw.user_id = user.username;
  • Convert weight goals: insert into weight_goal select null, user.id, uwg.start_date, uwg.complete_by, uwg.goal_weight, uwg.comment from ugomo_weight_goal uwg inner join user on uwg.user_id = user.username;
  • Need body weight page, database table, by units, entry mechanism
  • ugomo_user_weight -- need table
  • ugomo_user_weight_goal -- need table
  • Need page under profile for weight
  • Need list of weight entries
  • Need edit / add box for weight entries
  • User "leh" swim distance troubles


High priority next items to fix:
  • More body weight tracking changes
  • Need units for entry and switchable display (defaults to user's units)
  • Need list of weight goals
  • Need edit / add box for weight goals
  • Need graph: there was a line graph under it that had body weight --- again, date on x axis. Weight on y-axis.
  • Month calendar is foozed (not showing workouts by date filter correctly) & doesn't show currently selected year/month / doesn't have nav bar, yearnav doesn't work for this
  • Fancy Table distances aren't right
  • User profile needs separators selection (metric or imperial, commas or periods as appropriate)
  • User preferences box not working because non-existent
  • Quick homepage graph of swim/bike/run volume
  • The date goes on the x-axis. Hours go on the y-axis. Stacked bar graph such that if I swim 30 minutes, run for an hour, and ride for an hour, there is a pink rectangle (swim) topped by a yellow rectangle (run) topped by a green rectangle (bike).
  • Slow load times on home page (between 2000-3000ms, suspect it's challenge leaderboards
  • Challenges on home screen are super busy
  • Mobile workout logging not exactly working -- double check mobile edit screen
  • Challenges used to show X day of X remaining -- add this back in?


After this list is completed, it'll be time to get onto the medium priority ones -- there's still plenty to do, believe me!