mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
Measure and expose DNS programming latency from Kubernetes plugin. (#3171)
For now metric is measure only for headless services. Informer has been slighlty refactored, so the code can measure latency without storing extra fields on Endpoint struct. Signed-off-by: Janek Łukaszewicz <janluk@google.com> Suggestions from code review Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
@@ -44,10 +44,10 @@ type EndpointPort struct {
|
||||
func EndpointsKey(name, namespace string) string { return name + "." + namespace }
|
||||
|
||||
// ToEndpoints converts an api.Endpoints to a *Endpoints.
|
||||
func ToEndpoints(obj interface{}) interface{} {
|
||||
func ToEndpoints(obj interface{}) (*api.Endpoints, *Endpoints) {
|
||||
end, ok := obj.(*api.Endpoints)
|
||||
if !ok {
|
||||
return nil
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
e := &Endpoints{
|
||||
@@ -93,9 +93,7 @@ func ToEndpoints(obj interface{}) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
*end = api.Endpoints{}
|
||||
|
||||
return e
|
||||
return end, e
|
||||
}
|
||||
|
||||
// CopyWithoutSubsets copies e, without the subsets.
|
||||
|
||||
Reference in New Issue
Block a user