~blu/artemis

e6e7d81f0e1df65e7ad8719f39e4b814425bf2db — Bryant Conquest 1 year, 4 months ago cbfe94f
add health checkpoint
1 files changed, 7 insertions(+), 0 deletions(-)

M main.go
M main.go => main.go +7 -0
@@ 31,6 31,12 @@ type Handler struct {
	etags    map[string]bool
}

func HealthCheckHandler() http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("ARTEMIS lives!"))
	})
}

func MetricsHandler() http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		tsweb.VarzHandler(w, r)


@@ 145,6 151,7 @@ func main() {
	mux.Handle("/purge", Metrics(Logger(Purge(&h))))
	mux.Handle("/metrics/json", Metrics(Logger(expvar.Handler())))
	mux.Handle("/metrics/prometheus", Metrics(Logger(MetricsHandler())))
	mux.Handle("/health", Metrics(Logger(HealthCheckHandler())))

	log.Println("artemis started on 8080")
	log.Fatal(http.ListenAndServe(":8080", mux))