Procházet zdrojové kódy

feat(metrics): print metrics in topo order

ngjaying před 5 roky
rodič
revize
dad23dec15
1 změnil soubory, kde provedl 8 přidání a 6 odebrání
  1. 8 6
      xstream/streams.go

+ 8 - 6
xstream/streams.go

@@ -102,22 +102,24 @@ func (s *TopologyNew) Open() <-chan error {
 	return s.drain
 }
 
-func (s *TopologyNew) GetMetrics() map[string]interface{} {
-	result := make(map[string]interface{})
+func (s *TopologyNew) GetMetrics() (keys []string, values []interface{}) {
 	for _, node := range s.sources {
 		for k, v := range node.GetMetrics() {
-			result[k] = v
+			keys = append(keys, k)
+			values = append(values, v)
 		}
 	}
 	for _, node := range s.ops {
 		for k, v := range node.GetMetrics() {
-			result[k] = v
+			keys = append(keys, k)
+			values = append(values, v)
 		}
 	}
 	for _, node := range s.sinks {
 		for k, v := range node.GetMetrics() {
-			result[k] = v
+			keys = append(keys, k)
+			values = append(values, v)
 		}
 	}
-	return result
+	return
 }