Ejemplo n.º 1
0
func requireProgTimes(s *gcstats.GcStats) {
	if !s.HaveProgTimes() {
		fmt.Fprintln(os.Stderr,
			"This analysis requires program execution times, which are missing from\n"+
				"this GC trace. Please see 'go doc gcstats' for how to enable these.")
		os.Exit(1)
	}
}
Ejemplo n.º 2
0
func doSummary(s *gcstats.GcStats) {
	// Pause time: Max, 99th %ile, 95th %ile, mean
	// Mutator utilization
	// 50ms mutator utilization: Min, 1st %ile, 5th %ile
	pauseTimes := stats.Sample{Xs: []float64{}}
	for _, stop := range s.Stops() {
		pauseTimes.Xs = append(pauseTimes.Xs, float64(stop.Duration))
	}
	pauseTimes.Sort()
	fmt.Print("Pause times: max=", ns(pauseTimes.Percentile(1)), " 99th %ile=", ns(pauseTimes.Percentile(.99)), " 95th %ile=", ns(pauseTimes.Percentile(.95)), " mean=", ns(pauseTimes.Mean()), "\n")

	if s.HaveProgTimes() {
		fmt.Print("Mutator utilization: ", pct(s.MutatorUtilization()), "\n")

		fmt.Print("50ms mutator utilization: min=", pct(s.MMUs([]int{50000000})[0]), "\n")
	}
}