Newer
Older
packetLoss = float64(deployment.InterDomainPacketLoss)
} else {
log.Error("Error casting element: " + elemName)
}
// For compatiblity reasons, set to default value if 0
if maxThroughput == 0 {
maxThroughput = DEFAULT_THROUGHPUT_LINK
}
nc.Throughput = maxThroughput
nc.Latency = latency
nc.Jitter = jitter
nc.PacketLoss = packetLoss
return nc
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
}
// printFlowNamesFromList -
func printFlowNamesFromList(list []*SegAlgoFlow) string {
str := ""
for _, flow := range list {
str += flow.Name + "."
}
return str
}
// printFlows -
func printFlows(segment *SegAlgoSegment) {
log.Info("Flows on segment ", segment.Name)
for _, flow := range segment.Flows {
log.Info(printFlow(flow))
}
}
// printFlow -
func printFlow(flow *SegAlgoFlow) string {
s0 := fmt.Sprintf("%x", &flow)
s1 := flow.Name + "(" + s0 + ")"
s2t := fmt.Sprintf("%f", flow.ConfiguredNetChar.Throughput)
s2l := fmt.Sprintf("%f", flow.ConfiguredNetChar.Latency)
s2j := fmt.Sprintf("%f", flow.ConfiguredNetChar.Jitter)
s2p := fmt.Sprintf("%f", flow.ConfiguredNetChar.PacketLoss)
s3a := fmt.Sprintf("%f", flow.AllocatedThroughput)
s4a := fmt.Sprintf("%f", flow.AllocatedThroughputLowerBound)
s5a := fmt.Sprintf("%f", flow.AllocatedThroughputUpperBound)
s3m := fmt.Sprintf("%f", flow.MaxPlannedThroughput)
s4m := fmt.Sprintf("%f", flow.MaxPlannedLowerBound)
s5m := fmt.Sprintf("%f", flow.MaxPlannedUpperBound)
s3p := fmt.Sprintf("%f", flow.PlannedThroughput)
s4p := fmt.Sprintf("%f", flow.PlannedLowerBound)
s5p := fmt.Sprintf("%f", flow.PlannedUpperBound)
s6 := fmt.Sprintf("%f", flow.CurrentThroughput)
s7l := fmt.Sprintf("%f", flow.ComputedLatency)
s7j := fmt.Sprintf("%f", flow.ComputedJitter)
s7p := fmt.Sprintf("%f", flow.ComputedPacketLoss)
s8l := fmt.Sprintf("%f", flow.AppliedNetChar.Latency)
s8j := fmt.Sprintf("%f", flow.AppliedNetChar.Jitter)
s8p := fmt.Sprintf("%f", flow.AppliedNetChar.PacketLoss)
str := s1 + ": " + "Current: " + s6 + " - Configured: [" + s2t + "-" + s2l + "-" + s2j + "-" + s2p + "] Allocated: " + s3a + "[" + s4a + "-" + s5a + "]" + " - MaxPlanned: " + s3m + "[" + s4m + "-" + s5m + "]" + " - Planned: " + s3p + "[" + s4p + "-" + s5p + "] Computed Net Char: [" + s7l + "-" + s7j + "-" + s7p + "] Applied Net Char: [" + s8l + "-" + s8j + "-" + s8p + "]"
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
str += printPath(flow.Path)
return str
}
// printPath -
func printPath(path *SegAlgoPath) string {
str := ""
first := true
if path != nil {
str = "Path: "
for _, segment := range path.Segments {
if first {
str += segment.Name
first = false
} else {
str += "..." + segment.Name
}
}
}
return str
}