Reduce metrics mechanism to just support fastdp

This commit is contained in:
Bryan Boreham committed 2016-10-21 14:44:12 +01:00
1 parent 0458d32089
commit 4d8a40c0b5
2 files changed
+5 -20

No files matched your search

+1 -16
View File
@@ -42,29 +42,14 @@ 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(OverlaySwitchDiagnostics)
diagnostics := make(map[string]interface{})
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()