summaryrefslogtreecommitdiffstats
path: root/routers/admin
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-22 09:21:57 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-22 09:21:57 -0400
commitfd1831052c3a79492643b89512282fc66f34dd8d (patch)
tree2d1146e02a6c4efd6901ca9d966c085910bf6939 /routers/admin
parentf9c07c4186b61a1548d9a908fe6228bd130f4f92 (diff)
downloadgitea-fd1831052c3a79492643b89512282fc66f34dd8d.tar.gz
gitea-fd1831052c3a79492643b89512282fc66f34dd8d.zip
Update session
Diffstat (limited to 'routers/admin')
-rw-r--r--routers/admin/admin.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index 57a46d1dfe..c0f39f7159 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -17,7 +17,10 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+var startTime = time.Now()
+
var sysStatus struct {
+ Uptime string
NumGoroutine int
// General statistics.
@@ -58,6 +61,8 @@ var sysStatus struct {
}
func updateSystemStatus() {
+ sysStatus.Uptime = base.TimeSincePro(startTime)
+
m := new(runtime.MemStats)
runtime.ReadMemStats(m)
sysStatus.NumGoroutine = runtime.NumGoroutine()
@@ -88,8 +93,8 @@ func updateSystemStatus() {
sysStatus.NextGC = base.FileSize(int64(m.NextGC))
sysStatus.LastGC = fmt.Sprintf("%.1fs", float64(time.Now().UnixNano()-int64(m.LastGC))/1000/1000/1000)
- sysStatus.PauseTotalNs = fmt.Sprintf("%.1fs", float64(m.PauseTotalNs/1000/1000/1000))
- sysStatus.PauseNs = fmt.Sprintf("%.3fs", float64(m.PauseNs[(m.NumGC+255)%256]/1000/1000/1000))
+ sysStatus.PauseTotalNs = fmt.Sprintf("%.1fs", float64(m.PauseTotalNs)/1000/1000/1000)
+ sysStatus.PauseNs = fmt.Sprintf("%.3fs", float64(m.PauseNs[(m.NumGC+255)%256])/1000/1000/1000)
sysStatus.NumGC = m.NumGC
}
@@ -151,6 +156,9 @@ func Config(ctx *middleware.Context) {
ctx.Data["CacheAdapter"] = base.CacheAdapter
ctx.Data["CacheConfig"] = base.CacheConfig
+ ctx.Data["SessionProvider"] = base.SessionProvider
+ ctx.Data["SessionConfig"] = base.SessionConfig
+
ctx.Data["PictureService"] = base.PictureService
ctx.Data["PictureRootPath"] = base.PictureRootPath