telemetry: Remove a metric, clarify another, and fix tests

This commit is contained in:
Matthew Holt 2018-03-25 21:50:07 -06:00
parent 33aeb1cb5c
commit 8039a7127f
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
2 changed files with 4 additions and 6 deletions

View file

@ -121,9 +121,7 @@ func (cfg *Config) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certif
// })
cert, err := cfg.getCertDuringHandshake(strings.ToLower(clientHello.ServerName), true, true)
if err == nil {
go telemetry.Increment("tls_handshake_count")
} else {
go telemetry.Append("tls_handshake_error", err.Error())
go telemetry.Increment("tls_handshake_count") // TODO: This is a "best guess" for now, we need something listener-level
}
return &cert.Certificate, err
}

View file

@ -31,7 +31,7 @@ func TestInit(t *testing.T) {
t.Errorf("Second call to Init should have panicked")
}
}()
Init(id) // should panic
Init(id, nil) // should panic
}
func TestInitEmptyUUID(t *testing.T) {
@ -41,7 +41,7 @@ func TestInitEmptyUUID(t *testing.T) {
t.Errorf("Call to Init with empty UUID should have panicked")
}
}()
Init(uuid.UUID([16]byte{}))
Init(uuid.UUID([16]byte{}), nil)
}
func TestSet(t *testing.T) {
@ -92,7 +92,7 @@ func doInit(t *testing.T) uuid.UUID {
if err != nil {
t.Fatalf("Could not make UUID: %v", err)
}
Init(id)
Init(id, nil)
return id
}