Exemplo n.º 1
0
func (v *ViewEvent) Init() {
	v.mongosWidget = widgets.NewClusterRPSWidget("mongos", "ms")
	v.replica1Widget = widgets.NewClusterRPSWidget("Rpl1", "p1")

	v.mongosWidget_2 = widgets.NewClusterRPSWidget("MongoS", "p4")
	v.replica1Widget_2 = widgets.NewClusterRPSWidget("Rpl1", "p7")

	v.dash = widgets.Dash()
}
Exemplo n.º 2
0
func (v *ViewRPS) Init() {
	v.mongosWidget = widgets.NewClusterRPSWidget("mongos", "ms")

	for i := 0; i < len(v.replicas); i++ {
		v.replicas[i] = widgets.NewClusterRPSWidget("Repl_"+fmt.Sprint(int(i/3+1))+"_"+fmt.Sprint(i-int(i/3)*3), fmt.Sprintf("p%d", i+1))
	}

	for i := 0; i < len(v.chunks); i++ {
		v.chunks[i] = widgets.NewChunkWidget("sh_"+fmt.Sprint(i), i)
	}

}
Exemplo n.º 3
0
func (v *ViewMain) Init() {
	v.rpsWidgets[0] = widgets.NewClusterRPSWidget("MongoS", "ms")

	for i := 1; i < len(v.rpsWidgets); i++ {
		v.rpsWidgets[i] = widgets.NewClusterRPSWidget("MongoD_"+fmt.Sprint(i), fmt.Sprintf("p%d", i))
	}

	v.serverW_mongos = widgets.NewServerWidget("MongoS", "ms")

	for i := 0; i < 3; i++ {
		v.shards[i][0] = widgets.NewServerWidget("Repl_"+fmt.Sprint(i)+"_PRI", fmt.Sprintf("p%d", i*3+1))
		v.shards[i][1] = widgets.NewServerWidget("Repl_"+fmt.Sprint(i)+"_SEC", fmt.Sprintf("p%d", i*3+2))
		v.shards[i][2] = widgets.NewServerWidget("Repl_"+fmt.Sprint(i)+"_SEC", fmt.Sprintf("p%d", i*3+3))
	}

	v.statusBar = widgets.StatusBar()
}