blob: 15697ea18975cda08b411b7fa8cb7f319149df88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
package grilist
import (
"fmt"
"net/http"
"runtime"
"github.com/julienschmidt/httprouter"
)
func (g *Grilist) HealthCheck(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
var mem runtime.MemStats
runtime.ReadMemStats(&mem)
w.Write([]byte(fmt.Sprintf("mem in use: %d\nopen g.DB connections: %d", mem.Alloc, g.DB.Stats().OpenConnections)))
}
|