summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Borg <jakob@kastelo.net>2024-01-15 13:32:46 +0100
committerJakob Borg <jakob@kastelo.net>2024-01-15 13:32:46 +0100
commit2fcc1ba1d632a813b3e664a092500ea70caa234d (patch)
tree10b81655eb98f8ba6fd375d2eb86883feda12f96
parent9a24a85ec9c67d3b04e5c7bf5cc93364e45396fa (diff)
-rw-r--r--cmd/ursrv/aggregate/analytics.go6
-rw-r--r--cmd/ursrv/report/aggregation_report.go10
2 files changed, 7 insertions, 9 deletions
diff --git a/cmd/ursrv/aggregate/analytics.go b/cmd/ursrv/aggregate/analytics.go
index eb9e6acd0..fb14ee4bb 100644
--- a/cmd/ursrv/aggregate/analytics.go
+++ b/cmd/ursrv/aggregate/analytics.go
@@ -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
}
@@ -160,7 +160,7 @@ next:
Key: group,
Count: a.Count,
Percentage: a.Percentage,
- Items: []report.Analytic{a},
+ Children: []report.Analytic{a},
})
}
diff --git a/cmd/ursrv/report/aggregation_report.go b/cmd/ursrv/report/aggregation_report.go
index 75a076732..b096e31a6 100644
--- a/cmd/ursrv/report/aggregation_report.go
+++ b/cmd/ursrv/report/aggregation_report.go
@@ -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"`
@@ -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"`
}
@@ -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 {
@@ -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
}