Expose overlay metrics from fastdp

and allow them to pass through OverlaySwitch
This commit is contained in:
Bryan Boreham committed 2016-10-20 16:25:16 +01:00
1 parent 6d5af85eee
commit 00c86fed42
2 files changed
+38 -5

No files matched your search

+16 -1
View File
@@ -42,14 +42,29 @@ func (osw *OverlaySwitch) AddFeaturesTo(features map[string]string) {
features["Overlays"] = strings.Join(osw.overlayNames, " ")
}
type OverlaySwitchDiagnostics map[string]interface{}
func (osw *OverlaySwitch) Diagnostics() interface{} {
diagnostics := make(map[string]interface{})
diagnostics := make(OverlaySwitchDiagnostics)
for name, overlay := range osw.overlays {
diagnostics[name] = overlay.Diagnostics()
}
return diagnostics
}
type MetricsReporter interface {
Metrics() interface{}
}
func (d OverlaySwitchDiagnostics) Metrics() interface{} {
for _, entry := range d {
if fastDPEntry, ok := entry.(MetricsReporter); ok {
return fastDPEntry.Metrics()
}
}
return nil
}
func (osw *OverlaySwitch) InvalidateRoutes() {
for _, overlay := range osw.overlays {
overlay.InvalidateRoutes()