Add ability to get statistics in json format
This commit is contained in:
@@ -28,4 +28,10 @@ func TestStatics(t *testing.T) {
|
||||
StatisticsMap.AddStatistics("POST", "/api/user/xiemengjun", "&admin.user", time.Duration(13000))
|
||||
StatisticsMap.AddStatistics("DELETE", "/api/user", "&admin.user", time.Duration(1400))
|
||||
t.Log(StatisticsMap.GetMap())
|
||||
|
||||
jsonString, err := StatisticsMap.GetMapJSON()
|
||||
if err != nil {
|
||||
t.Errorf(err.Error())
|
||||
}
|
||||
t.Log(string(jsonString))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user