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

feat: basic implementation of branch statistics

This commit is contained in:
Ferdinand Mütsch
2022-01-02 13:39:20 +01:00
parent fd6c36832e
commit 2bc53e6f11
16 changed files with 844 additions and 730 deletions

View File

@@ -16,6 +16,7 @@ type Duration struct {
Editor string `json:"editor"`
OperatingSystem string `json:"operating_system"`
Machine string `json:"machine"`
Branch string `json:"branch"`
NumHeartbeats int `json:"-" hash:"ignore"`
GroupHash string `json:"-" hash:"ignore"`
}
@@ -30,6 +31,7 @@ func NewDurationFromHeartbeat(h *Heartbeat) *Duration {
Editor: h.Editor,
OperatingSystem: h.OperatingSystem,
Machine: h.Machine,
Branch: h.Branch,
NumHeartbeats: 1,
}
return d.Hashed()
@@ -56,6 +58,8 @@ func (d *Duration) GetKey(t uint8) (key string) {
key = d.OperatingSystem
case SummaryMachine:
key = d.Machine
case SummaryBranch:
key = d.Branch
}
if key == "" {