예제 #1
0
 def add(self, entry):
     ip1 = get_int_from_ip(entry[ORIGIN_IP])
     i = ip1 * (self.x_size - 1) / math.pow(256., 4)
     ip2 = get_int_from_ip(entry[DESTINATION_IP])
     j = ip2 * (self.y_size - 1) / math.pow(256., 4)
     value = entry[PEER_LATENCY]
     Heatmap.add(self, i, j, value)
 def add(self, entry):
     ip1 = get_int_from_ip(entry[ORIGIN_IP])
     i = ip1 * (self.x_size - 1) / math.pow(256.0, 4)
     ip2 = get_int_from_ip(entry[DESTINATION_IP])
     j = ip2 * (self.y_size - 1) / math.pow(256.0, 4)
     value = entry[PEER_LATENCY]
     Heatmap.add(self, i, j, value)
예제 #3
0
def pre_encoding(data):
    ips = (utils.get_int_from_ip(data[ORIGIN_IP]),
           utils.get_int_from_ip(data[DESTINATION_IP]))
    latency = latency_transposition(data[PEER_LATENCY])
    return ips, latency
예제 #4
0
def pre_encoding(data):
    ips = (utils.get_int_from_ip(data[ORIGIN_IP]),utils.get_int_from_ip(data[DESTINATION_IP]))
    latency = latency_transposition(data[PEER_LATENCY])
    return ips,latency