Esempio n. 1
0
func doMMU(s *gcstats.GcStats) {
	// 1e9 ns = 1000 ms
	windows := vec.Logspace(-3, 0, samples, 10)
	plot := newPlot("granularity", windows, "--style", "mmu")
	plot.addSeries("MMU", func(window float64) float64 {
		return s.MMU(int(window * 1e9))
	})
	showPlot(plot)
}
Esempio n. 2
0
func doMUDMap(s *gcstats.GcStats) {
	windows := ints(vec.Logspace(6, 9, 100, 10))
	muds := make([]*gcstats.MUD, len(windows))
	for i, windowNS := range windows {
		muds[i] = s.MutatorUtilizationDistribution(windowNS)
	}
	// gnuplot "nonuniform matrix" format
	fmt.Printf("%d ", len(windows)+1)
	for _, windowNS := range windows {
		fmt.Printf("%d ", windowNS)
	}
	fmt.Print("\n")
	utils := vec.Linspace(0, 1, 100)
	for _, util := range utils {
		fmt.Printf("%g ", util)
		for _, mud := range muds {
			fmt.Printf("%g ", mud.CDF(util))
		}
		fmt.Print("\n")
	}
}
Esempio n. 3
0
func doMUT(s *gcstats.GcStats) {
	windows := vec.Logspace(-3, 0, samples, 10)
	muds := make(map[float64]*gcstats.MUD)
	for _, window := range windows {
		muds[window] = s.MutatorUtilizationDistribution(int(window * 1e9))
	}

	plot := newPlot("granularity", windows, "--style", "mut")
	type config struct {
		label string
		x     float64
	}
	for _, c := range []config{
		{"100%ile", 0},
		{"99.9%ile", 0.001},
		{"99%ile", 0.01},
		{"90%ile", 0.1},
	} {
		plot.addSeries(c.label, func(x float64) float64 {
			return muds[x].InvCDF(c.x)
		})
	}
	showPlot(plot)
}