Filter out zero values

This commit is contained in:
Jakob Borg 2014-06-16 16:48:05 +02:00
parent d0aef07a38
commit d71a782179

32
main.go
View File

@ -173,14 +173,30 @@ func reportHandler(w http.ResponseWriter, r *http.Request) {
nodes++ nodes++
versions[rep.Version]++ versions[rep.Version]++
platforms[rep.Platform]++ platforms[rep.Platform]++
numRepos = append(numRepos, rep.NumRepos) if rep.NumRepos > 0 {
numNodes = append(numNodes, rep.NumNodes) numRepos = append(numRepos, rep.NumRepos)
totFiles = append(totFiles, rep.TotFiles) }
maxFiles = append(maxFiles, rep.RepoMaxFiles) if rep.NumNodes > 0 {
totMiB = append(totMiB, rep.TotMiB) numNodes = append(numNodes, rep.NumNodes)
maxMiB = append(maxMiB, rep.RepoMaxMiB) }
memoryUsage = append(memoryUsage, rep.MemoryUsageMiB) if rep.TotFiles > 0 {
sha256Perf = append(sha256Perf, rep.SHA256Perf) totFiles = append(totFiles, rep.TotFiles)
}
if rep.RepoMaxFiles > 0 {
maxFiles = append(maxFiles, rep.RepoMaxFiles)
}
if rep.TotMiB > 0 {
totMiB = append(totMiB, rep.TotMiB)
}
if rep.RepoMaxMiB > 0 {
maxMiB = append(maxMiB, rep.RepoMaxMiB)
}
if rep.MemoryUsageMiB > 0 {
memoryUsage = append(memoryUsage, rep.MemoryUsageMiB)
}
if rep.SHA256Perf > 0 {
sha256Perf = append(sha256Perf, rep.SHA256Perf)
}
if rep.MemorySize > 0 { if rep.MemorySize > 0 {
memorySize = append(memorySize, rep.MemorySize) memorySize = append(memorySize, rep.MemorySize)
} }