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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user