예제 #1
0
파일: status.go 프로젝트: jmptrader/vitess
func addStatusParts(qsc tabletserver.Controller) {
	servenv.AddStatusPart("Tablet", tabletTemplate, func() interface{} {
		return map[string]interface{}{
			"Tablet":               topo.NewTabletInfo(agent.Tablet(), -1),
			"BlacklistedTables":    agent.BlacklistedTables(),
			"DisallowQueryService": agent.DisallowQueryService(),
			"DisableUpdateStream":  !agent.EnableUpdateStream(),
		}
	})
	servenv.AddStatusFuncs(template.FuncMap{
		"github_com_youtube_vitess_health_html_name": healthHTMLName,
	})
	servenv.AddStatusPart("Health", healthTemplate, func() interface{} {
		return &healthStatus{
			Records: agent.History.Records(),
			Config:  tabletmanager.ConfigHTML(),
		}
	})
	qsc.AddStatusPart()
	servenv.AddStatusPart("Binlog Player", binlogTemplate, func() interface{} {
		return agent.BinlogPlayerMap.Status()
	})
	if onStatusRegistered != nil {
		onStatusRegistered()
	}
}
예제 #2
0
파일: status.go 프로젝트: richarwu/vitess
func addStatusParts(qsc tabletserver.QueryServiceControl) {
	servenv.AddStatusPart("Tablet", tabletTemplate, func() interface{} {
		return map[string]interface{}{
			"Tablet":              agent.Tablet(),
			"BlacklistedTables":   agent.BlacklistedTables(),
			"DisableQueryService": agent.DisableQueryService(),
		}
	})
	if agent.IsRunningHealthCheck() {
		servenv.AddStatusFuncs(template.FuncMap{
			"github_com_youtube_vitess_health_html_name": healthHTMLName,
		})
		servenv.AddStatusPart("Health", healthTemplate, func() interface{} {
			return &healthStatus{
				Records: agent.History.Records(),
				Config:  tabletmanager.ConfigHTML(),
			}
		})
	}
	qsc.AddStatusPart()
	servenv.AddStatusPart("Binlog Player", binlogTemplate, func() interface{} {
		return agent.BinlogPlayerMap.Status()
	})
	if onStatusRegistered != nil {
		onStatusRegistered()
	}
}