Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Jan 15, 2024
1 parent 9a24a85 commit 2fcc1ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cmd/ursrv/aggregate/analytics.go
Expand Up @@ -150,8 +150,8 @@ next:
if res[i].Key == group {
res[i].Count += a.Count
res[i].Percentage += a.Percentage
if len(res[i].Items) < perGroup {
res[i].Items = append(res[i].Items, a)
if len(res[i].Children) < perGroup {
res[i].Children = append(res[i].Children, a)
}
continue next
}
Expand All @@ -160,7 +160,7 @@ next:
Key: group,
Count: a.Count,
Percentage: a.Percentage,
Items: []report.Analytic{a},
Children: []report.Analytic{a},
})
}

Expand Down
10 changes: 4 additions & 6 deletions cmd/ursrv/report/aggregation_report.go
Expand Up @@ -13,8 +13,8 @@ import (

type AggregatedReport struct {
Date time.Time `json:"date"`
Features map[string][]Feature `json:"Features"`
FeatureGroups map[string][]FeatureGroup `json:"FeatureGroups"`
Features map[string][]Feature `json:"features"`
FeatureGroups map[string][]FeatureGroup `json:"featureGroups"`
Nodes int `json:"nodes"`
VersionNodes map[string]int `json:"versionNodes"`
Categories []Category `json:"categories"`
Expand All @@ -35,9 +35,8 @@ type AggregatedReport struct {

type Category struct {
Values [4]float64 `json:"values"`
Key string `json:"key"`
Descr string `json:"descr"`
Unit string `json:"unit"`
Unit string `json:"unit,omitempty"`
Type NumberType `json:"type"`
}

Expand Down Expand Up @@ -68,7 +67,7 @@ type Analytic struct {
Key string `json:"key"`
Count int `json:"count"`
Percentage float64 `json:"percentage"`
Items []Analytic `json:"items"`
Children []Analytic `json:"children,omitempty"`
}

type Performance struct {
Expand Down Expand Up @@ -117,7 +116,6 @@ func (lm *LocationMap) Add(lat, lon float64) {
loc.Inc()
} else {
loc = Location{Latitude: lat, Longitude: lon, Count: 1}

}
lm.mapped[id] = loc
}
Expand Down

0 comments on commit 2fcc1ba

Please sign in to comment.