1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

feat: total heartbeats per summary (resolve #283)

This commit is contained in:
Ferdinand Mütsch
2021-12-22 10:17:05 +01:00
parent e14f8c1463
commit 92f6d44606
9 changed files with 42 additions and 7 deletions

View File

@@ -16,6 +16,14 @@ func (d Durations) Swap(i, j int) {
d[i], d[j] = d[j], d[i]
}
func (d Durations) TotalNumHeartbeats() int {
var total int
for _, e := range d {
total += e.NumHeartbeats
}
return total
}
func (d Durations) Sorted() Durations {
sort.Sort(d)
return d