package pokus.sd;

import java.net.InetAddress;
import cz.vutbr.feec.session.ping.RttVectorMeasurement;

public class MeasureRttDistancesToHosts {
	
	public double[] measureRtt(Landmark[] lm) {

		int maxNumOfThreads = 10; // kolik bude merit soucasne
		int pingCount = 3; // pocet opakovani mereni RTT (vybira se minimum)
		InetAddress[] address = new InetAddress[lm.length];
		for(int i=0; i<lm.length; i++) {
			address[i] = lm[i].getAddress();
		}
		
		double[] rttVector = RttVectorMeasurement.measureRttVector(address,
				maxNumOfThreads, pingCount);

		// vypis vysledku
		for (int i = 0; i < rttVector.length; i++) {
			System.out.println("ADDR:" + address[i] + ",  RTT value:" + rttVector[i]);
		}
		return rttVector;
	}
}
/*
 * seznam.cz
 * IP Address  	:  	 147.229.146.241
 * Location 	: 	CZECH REPUBLIC, JIHOMORAVSKY KRAJ, BRNO
 * Latitude / Longitude 	: 	49.2 LATITUDE, 16.633 LONGITUDE
 * Connecting through 	: 	BRNO UNIVERSITY OF TECHNOLOGY
 * Time Zone 	: 	UTC +01:00
 * 
 * 
 */