mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 23:43:27 +01:00
Remove failure-threshold property
This commit is contained in:
parent
f979957166
commit
339c1dfb04
@ -15,7 +15,6 @@ services:
|
||||
- name: twinnation # Name of your service, can be anything
|
||||
url: https://twinnation.org/actuator/health
|
||||
interval: 15s # Duration to wait between every status check (opt. default: 10s)
|
||||
failure-threshold: 3 # TODO
|
||||
conditions:
|
||||
- "$STATUS == 200"
|
||||
- name: github
|
||||
|
@ -2,7 +2,6 @@ services:
|
||||
- name: twinnation
|
||||
url: https://twinnation.org/actuator/health
|
||||
interval: 15s
|
||||
failure-threshold: 3
|
||||
conditions:
|
||||
- "$STATUS == 200"
|
||||
- name: github
|
||||
|
@ -34,9 +34,6 @@ func ParseConfigBytes(yamlBytes []byte) *Config {
|
||||
config = &Config{}
|
||||
yaml.Unmarshal(yamlBytes, config)
|
||||
for _, service := range config.Services {
|
||||
if service.FailureThreshold == 0 {
|
||||
service.FailureThreshold = 1
|
||||
}
|
||||
if service.Interval == 0 {
|
||||
service.Interval = 10 * time.Second
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ services:
|
||||
- name: twinnation
|
||||
url: https://twinnation.org/actuator/health
|
||||
interval: 15s
|
||||
failure-threshold: 3
|
||||
conditions:
|
||||
- "$STATUS == 200"
|
||||
- name: github
|
||||
@ -37,12 +36,6 @@ services:
|
||||
if config.Services[1].Interval != 10*time.Second {
|
||||
t.Errorf("Interval should have been %s, because it is the default value", 10*time.Second)
|
||||
}
|
||||
if config.Services[0].FailureThreshold != 3 {
|
||||
t.Errorf("FailureThreshold should have been %d", 3)
|
||||
}
|
||||
if config.Services[1].FailureThreshold != 1 {
|
||||
t.Errorf("FailureThreshold should have been %d, because it is the default value", 1)
|
||||
}
|
||||
if len(config.Services[0].Conditions) != 1 {
|
||||
t.Errorf("There should have been %d conditions", 1)
|
||||
}
|
||||
@ -65,7 +58,4 @@ services:
|
||||
if config.Services[0].Interval != 10*time.Second {
|
||||
t.Errorf("Interval should have been %s, because it is the default value", 10*time.Second)
|
||||
}
|
||||
if config.Services[0].FailureThreshold != 1 {
|
||||
t.Errorf("FailureThreshold should have been %d, because it is the default value", 1)
|
||||
}
|
||||
}
|
||||
|
@ -33,11 +33,10 @@ type Result struct {
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
Name string `yaml:"name"`
|
||||
Url string `yaml:"url"`
|
||||
Interval time.Duration `yaml:"interval,omitempty"`
|
||||
FailureThreshold int `yaml:"failure-threshold,omitempty"` // TODO: Implement
|
||||
Conditions []*Condition `yaml:"conditions"`
|
||||
Name string `yaml:"name"`
|
||||
Url string `yaml:"url"`
|
||||
Interval time.Duration `yaml:"interval,omitempty"`
|
||||
Conditions []*Condition `yaml:"conditions"`
|
||||
}
|
||||
|
||||
func (service *Service) getIp(result *Result) {
|
||||
|
Loading…
Reference in New Issue
Block a user