Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: perf/server/src/server/data.go

Issue 382313002: Adds tile handler to the perf server (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: More style fixes Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: perf/server/src/server/data.go
diff --git a/perf/server/src/server/data.go b/perf/server/src/server/data.go
index dc1ec5bcd752a8a00cf2352b07a75f41625d8bc4..49fb557793f57598b38a1930fb75c4ee147d9210 100644
--- a/perf/server/src/server/data.go
+++ b/perf/server/src/server/data.go
@@ -169,7 +169,7 @@ type Choices []string
type Dataset struct {
Traces []*Trace `json:"traces"`
ParamSet map[string]Choices `json:"param_set"`
- Commits []*types.Commit `json:"commits"`
+ Commits []*types.Commit `json:"commits"`
service *bigquery.Service
clusterSummaries *ClusterSummaries
}
@@ -548,19 +548,19 @@ func getParamSummaries(cluster []kmeans.Clusterable) [][]ValueWeight {
}
// average calculates and returns the average value of the given []float64.
-func average(xs[]float64)float64 {
+func average(xs []float64) float64 {
total := 0.0
- for _,v := range xs {
+ for _, v := range xs {
total += v
}
return total / float64(len(xs))
}
// sse calculates and returns the sum squared error from the given base of []float64.
-func sse(xs[]float64, base float64)float64 {
+func sse(xs []float64, base float64) float64 {
total := 0.0
- for _,v := range xs {
- total += math.Pow(v - base, 2)
+ for _, v := range xs {
+ total += math.Pow(v-base, 2)
}
return total
}
@@ -578,7 +578,7 @@ func getStepFit(trace []float64) StepFit {
if y0 == y1 {
continue
}
- d := math.Sqrt(sse(trace[:i], y0) + sse(trace[i:], y1)) / float64(len(trace))
+ d := math.Sqrt(sse(trace[:i], y0)+sse(trace[i:], y1)) / float64(len(trace))
if d < deviation {
deviation = d
stepSize = math.Abs(y0 - y1)
@@ -604,7 +604,7 @@ func GetClusterSummaries(observations, centroids []kmeans.Clusterable) *ClusterS
Traces: make([][][]float64, numSampleTraces),
ParamSummaries: getParamSummaries(cluster),
// Try fit on the centroid.
- StepFit: getStepFit(cluster[0].(*ctrace.ClusterableTrace).Values),
+ StepFit: getStepFit(cluster[0].(*ctrace.ClusterableTrace).Values),
}
for j, o := range cluster {
summary.Keys[j] = o.(*ctrace.ClusterableTrace).Key

Powered by Google App Engine
This is Rietveld 408576698