diff options
Diffstat (limited to 'grilist/health.go')
-rw-r--r-- | grilist/health.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/grilist/health.go b/grilist/health.go new file mode 100644 index 0000000..15697ea --- /dev/null +++ b/grilist/health.go | |||
@@ -0,0 +1,16 @@ | |||
1 | package grilist | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "net/http" | ||
6 | "runtime" | ||
7 | |||
8 | "github.com/julienschmidt/httprouter" | ||
9 | ) | ||
10 | |||
11 | func (g *Grilist) HealthCheck(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { | ||
12 | var mem runtime.MemStats | ||
13 | runtime.ReadMemStats(&mem) | ||
14 | |||
15 | w.Write([]byte(fmt.Sprintf("mem in use: %d\nopen g.DB connections: %d", mem.Alloc, g.DB.Stats().OpenConnections))) | ||
16 | } | ||