diff options
author | rtz12 <koenig@fagott.pw> | 2016-10-11 19:02:59 (UTC) |
---|---|---|
committer | rtz12 <koenig@fagott.pw> | 2016-10-11 19:02:59 (UTC) |
commit | ce5973c4024f22a8f8c63818109a2ca4f3be7bc4 (patch) | |
tree | e7b6b5d5c6e73451b489e97f90206a96bf9ed2df /grilist/health.go | |
parent | fbd746aef8c78067593f901afb0f255574392499 (diff) | |
parent | b5051d2358e12f877e5c52053dcf1a16959e4ded (diff) |
Merge branch 'master' of projekte.fagott.pw:grilist
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 | } | ||