Пример #1
0
func NewStat(data []float64) Stat {
	return Stat{
		Min:    stats.StatsMin(data),
		Max:    stats.StatsMax(data),
		Mean:   stats.StatsMean(data),
		StdDev: stats.StatsPopulationStandardDeviation(data),
		Total:  stats.StatsSum(data),
	}
}
Пример #2
0
func (r *Report) InitialDistributionScore() float64 {
	memoryCounts := []float64{}
	for _, instances := range r.InstancesByRep {
		memoryCount := 0.0
		for _, instance := range instances {
			if !r.IsAuctionedInstance(instance) {
				memoryCount += float64(instance.MemoryMB)
			}
		}
		memoryCounts = append(memoryCounts, memoryCount)
	}

	if stats.StatsSum(memoryCounts) == 0 {
		return 0
	}

	return stats.StatsPopulationStandardDeviation(memoryCounts) / stats.StatsMean(memoryCounts)
}
Пример #3
0
func (r *SVGReport) drawResults() {
	r.SVG.Text(border, 70, fmt.Sprintf("Distribution Scores: %.2f, Wait Time: %.2fs", stats.StatsSum(r.distributionScores), stats.StatsSum(r.waitTimes)), `text-anchor:start;font-size:20px;font-family:Helvetica Neue`)
}