예제 #1
0
파일: status.go 프로젝트: henryanand/vitess
func init() {
	servenv.OnRun(func() {
		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()}
			})
		}
		tabletserver.AddStatusPart()
		servenv.AddStatusPart("Binlog Player", binlogTemplate, func() interface{} {
			return agent.BinlogPlayerMap.Status()
		})
		if onStatusRegistered != nil {
			onStatusRegistered()
		}
	})
}
예제 #2
0
파일: health.go 프로젝트: henryanand/vitess
func init() {
	servenv.OnRun(func() {
		if *allowedReplicationLag > 0 {
			health.Register("replication_reporter", mysqlctl.MySQLReplicationLag(agent.Mysqld, *allowedReplicationLag))
		}
		health.Register("query_service_reporter", &queryServiceRunning{})
	})
}
예제 #3
0
파일: status.go 프로젝트: henryanand/vitess
func init() {
	servenv.OnRun(func() {
		servenv.AddStatusPart("Topology Cache", topoTemplate, func() interface{} {
			return resilientSrvTopoServer.CacheStatus()
		})
		servenv.AddStatusPart("Stats", statsTemplate, func() interface{} {
			return nil
		})
	})
}
예제 #4
0
func init() {
	servenv.OnRun(func() {
		http.Handle("/healthz", http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
			if err := agent.Healthy(); err != nil {
				http.Error(rw, fmt.Sprintf("500 internal server error: agent not healthy: %v", err), http.StatusInternalServerError)
				return
			}

			rw.Header().Set("Content-Length", fmt.Sprintf("%v", len(okMessage)))
			rw.WriteHeader(http.StatusOK)
			rw.Write(okMessage)
		}))
	})
}
예제 #5
0
func init() {
	servenv.OnRun(func() {
		gorpcvtctlserver.StartServer(ts)
	})
}
예제 #6
0
파일: status.go 프로젝트: henryanand/vitess
func init() {
	servenv.OnRun(func() {
		tabletserver.AddStatusPart()
	})
}
func init() {
	servenv.OnRun(func() {
		gorpcmysqlctlserver.StartServer(mysqld)
	})
}