rename probe.Healthy to probe.Success and renam probe.Unhealthy to probe.Failure.

This commit is contained in:
Mike Danese
2015-01-27 10:22:53 -08:00
parent 6eb0b89cbd
commit 5dc6362f8a
14 changed files with 33 additions and 33 deletions

View File

@@ -42,11 +42,11 @@ func (pr TCPProber) Probe(host string, port int) (probe.Status, error) {
func DoTCPProbe(addr string) (probe.Status, error) {
conn, err := net.Dial("tcp", addr)
if err != nil {
return probe.Unhealthy, nil
return probe.Failure, nil
}
err = conn.Close()
if err != nil {
glog.Errorf("unexpected error closing health check socket: %v (%#v)", err, err)
}
return probe.Healthy, nil
return probe.Success, nil
}

View File

@@ -35,8 +35,8 @@ func TestTcpHealthChecker(t *testing.T) {
expectError bool
}{
// The probe will be filled in below. This is primarily testing that a connection is made.
{probe.Healthy, true, false},
{probe.Unhealthy, false, false},
{probe.Success, true, false},
{probe.Failure, false, false},
}
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {