1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 11:30:39 +00:00

Added data table admin ui

This commit is contained in:
Lei Cao
2014-08-25 01:37:11 +08:00
parent 17006cfb26
commit 421b796f1a
3 changed files with 168 additions and 156 deletions

View File

@ -78,13 +78,16 @@ func (m *UrlMap) AddStatistics(requestMethod, requestUrl, requestController stri
}
// put url statistics result in io.Writer
func (m *UrlMap) GetMap() [][]string {
func (m *UrlMap) GetMap() map[string]interface{} {
m.lock.RLock()
defer m.lock.RUnlock()
resultLists := make([][]string, 0)
var result = []string{"requestUrl", "method", "times", "used", "max used", "min used", "avg used"}
resultLists = append(resultLists, result)
var fields = []string{"requestUrl", "method", "times", "used", "max used", "min used", "avg used"}
resultLists := make([][]string, 0)
content := make(map[string]interface{})
content["Fields"] = fields
for k, v := range m.urlmap {
for kk, vv := range v {
result := []string{
@ -99,7 +102,8 @@ func (m *UrlMap) GetMap() [][]string {
resultLists = append(resultLists, result)
}
}
return resultLists
content["Data"] = resultLists
return content
}
// global statistics data map