Show response time, status code etc.

https://github.com/thoas/stats

Fixed #103

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-06-26 12:21:32 +08:00
parent 82cb2f5246
commit f65ccaaa8a
8 changed files with 206 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ type SectionAPI struct {
StatGoURI string `yaml:"stat_go_uri"`
StatAppURI string `yaml:"stat_app_uri"`
ConfigURI string `yaml:"config_uri"`
SysStatURI string `yaml:"sys_stat_uri"`
}
// SectionAndroid is sub seciont of config.
@@ -99,6 +100,7 @@ func BuildDefaultPushConf() ConfYaml {
conf.API.StatGoURI = "/api/stat/go"
conf.API.StatAppURI = "/api/stat/app"
conf.API.ConfigURI = "/api/config"
conf.API.SysStatURI = "/sys/stats"
// Android
conf.Android.Enabled = false

View File

@@ -13,6 +13,7 @@ api:
stat_go_uri: "/api/stat/go"
stat_app_uri: "/api/stat/app"
config_uri: "/api/config"
sys_stat_uri: "/sys/stats"
android:
enabled: true

View File

@@ -49,5 +49,6 @@ func TestDefaultConfig(t *testing.T) {
config := BuildDefaultPushConf()
assert.Equal(t, "8088", config.Core.Port)
assert.Equal(t, "/sys/stats", config.API.SysStatURI)
assert.False(t, config.Android.Enabled)
}