From 0a29fa65abb3eb98ef619b4d041dc995f4650f6e Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Sun, 9 Sep 2018 14:28:02 +0200 Subject: [PATCH] cmd/ursrv: Display more relevant data (#17) --- cmd/ursrv/main.go | 6 +++--- cmd/ursrv/static/index.html | 26 +++++++++++++++----------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/cmd/ursrv/main.go b/cmd/ursrv/main.go index 2a2d5910..e7f7da56 100644 --- a/cmd/ursrv/main.go +++ b/cmd/ursrv/main.go @@ -61,7 +61,7 @@ var funcs = map[string]interface{}{ parts = append(parts, part) } if len(input) > 0 { - parts = append(parts, input[:len(input)]) + parts = append(parts, input[:]) } return parts[whichPart-1] }, @@ -1329,10 +1329,10 @@ func getReport(db *sql.DB) map[string]interface{} { r["nodes"] = nodes r["versionNodes"] = reports r["categories"] = categories - r["versions"] = group(byVersion, analyticsFor(versions, 2000), 5) + r["versions"] = group(byVersion, analyticsFor(versions, 2000), 10) r["versionPenetrations"] = penetrationLevels(analyticsFor(versions, 2000), []float64{50, 75, 90, 95}) r["platforms"] = group(byPlatform, analyticsFor(platforms, 2000), 5) - r["compilers"] = group(byCompiler, analyticsFor(compilers, 2000), 3) + r["compilers"] = group(byCompiler, analyticsFor(compilers, 2000), 5) r["builders"] = analyticsFor(builders, 12) r["featureOrder"] = featureOrder r["locations"] = locations diff --git a/cmd/ursrv/static/index.html b/cmd/ursrv/static/index.html index b8de9593..d459ed15 100644 --- a/cmd/ursrv/static/index.html +++ b/cmd/ursrv/static/index.html @@ -385,18 +385,20 @@ found in the LICENSE file. {{range .versions}} - {{if gt .Percentage 0.5}} + {{if gt .Percentage 0.1}} {{.Key}} {{.Count}} {{.Percentage | printf "%.01f"}}% {{range .Items}} - - {{.Key}} - {{.Count}} - {{.Percentage | printf "%.01f"}}% - + {{if gt .Percentage 0.1}} + + {{.Key}} + {{.Count}} + {{.Percentage | printf "%.01f"}}% + + {{end}} {{end}} {{end}} {{end}} @@ -470,11 +472,13 @@ found in the LICENSE file. {{.Percentage | printf "%.01f"}}% {{range .Items}} - - {{.Key}} - {{.Count}} - {{.Percentage | printf "%.01f"}}% - + {{if or (gt .Percentage 0.1) (eq .Key "Others")}} + + {{.Key}} + {{.Count}} + {{.Percentage | printf "%.01f"}}% + + {{end}} {{end}} {{end}}