Example #1
0
func serversOverview(servers []engine.Server) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tURL\tReqs/sec\t50ile[ms]\t95ile[ms]\t99ile[ms]\tStatus codes %%\tNet. errors %%\tMessages\n")

	for _, e := range servers {
		serverOverview(t, e)
	}
	return t.String()
}
Example #2
0
func serversView(srvs []engine.Server) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tURL\n")
	if len(srvs) == 0 {
		return t.String()
	}
	for _, v := range srvs {
		fmt.Fprint(t, serverView(&v))
	}
	return t.String()
}
Example #3
0
func backendsView(bs []engine.Backend) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tType\n")

	if len(bs) == 0 {
		return t.String()
	}
	for _, v := range bs {
		fmt.Fprint(t, backendView(&v))
	}
	return t.String()
}
Example #4
0
func frontendsView(fs []engine.Frontend) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tRoute\tBackend\tType\n")

	if len(fs) == 0 {
		return t.String()
	}
	for _, v := range fs {
		fmt.Fprint(t, frontendView(&v))
	}
	return t.String()
}
Example #5
0
func listenersView(ls []engine.Listener) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tProtocol\tNetwork\tAddress\tScope\n")

	if len(ls) == 0 {
		return t.String()
	}
	for _, l := range ls {
		fmt.Fprint(t, listenerView(&l))
	}
	return t.String()
}
Example #6
0
func hostsView(hs []engine.Host) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Name\tDefault\n")

	if len(hs) == 0 {
		return t.String()
	}
	for _, h := range hs {
		fmt.Fprint(t, hostView(&h))
	}
	return t.String()
}
Example #7
0
func frontendsOverview(frontends []engine.Frontend) string {
	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tRoute\tR/sec\t50ile[ms]\t95ile[ms]\t99ile[ms]\tStatus codes %%\tNet. errors %%\n")

	if len(frontends) == 0 {
		return t.String()
	}
	for _, l := range frontends {
		frontendOverview(t, l)
	}
	return t.String()
}
Example #8
0
func middlewaresView(ms []engine.Middleware) string {
	sort.Sort(&middlewareSorter{ms: ms})

	t := goterm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprint(t, "Id\tPriority\tType\tSettings\n")
	if len(ms) == 0 {
		return t.String()
	}
	for _, v := range ms {
		fmt.Fprint(t, middlewareView(&v))
	}
	return t.String()
}
Example #9
0
func main() {
	tm.Clear() // Clear current screen
	started := 100
	finished := 250

	// Based on http://golang.org/pkg/text/tabwriter
	totals := tm.NewTable(0, 10, 5, ' ', 0)
	fmt.Fprintf(totals, "Time\tStarted\tActive\tFinished\n")
	fmt.Fprintf(totals, "%s\t%d\t%d\t%d\n", "All", started, started-finished, finished)
	tm.Println(totals)

	tm.Flush()
}