Skip to content

Commit

Permalink
Show the max average speed when showing records
Browse files Browse the repository at this point in the history
When calculating bucket-statistics, we show the average of averages, but
here we show the max (records!).

Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be>
  • Loading branch information
jovandeginste committed Apr 14, 2024
1 parent 4f5f81a commit c8fb8e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/database/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ func (u *User) GetRecords(t WorkoutType) (*WorkoutRecord, error) {
&r.Distance: "max(total_distance)",
&r.MaxSpeed: "max(max_speed)",
&r.TotalUp: "max(total_up)",
&r.AverageSpeed: fmt.Sprintf("avg(total_distance / (total_duration / %d))", time.Second),
&r.AverageSpeedNoPause: fmt.Sprintf("avg(total_distance / ((total_duration - pause_duration) / %d))", time.Second),
&r.AverageSpeed: fmt.Sprintf("max(total_distance / (total_duration / %d))", time.Second),
&r.AverageSpeedNoPause: fmt.Sprintf("max(total_distance / ((total_duration - pause_duration) / %d))", time.Second),
}

for k, v := range mapping {
Expand Down

0 comments on commit c8fb8e1

Please sign in to comment.