1 import java.util.Arrays;
3 import java.util.ArrayList;
4 import iotruntime.master.CommunicationHandler;
6 public class TestClass_ProfilingStub {
8 public static void main(String[] args) throws Exception {
9 CommunicationHandler comHan = new CommunicationHandler(true);
11 //int[] ports = comHan.getCallbackPorts(numOfPorts);
13 //int localportsend = 5011;
14 //int localportrecv = 6011;
17 //String skeletonAddress = "128.195.136.163";
18 //String skeletonAddress = "128.195.204.132";
19 String skeletonAddress = "192.168.2.108";
20 //String callbackAddress = "128.195.204.132"; // dw-2.eecs.uci.edu (this machine)
21 String callbackAddress = "192.168.2.191";
24 //TestClassComplete_Stub tcstub = new TestClassComplete_Stub(localportsend, localportrecv, portsend, portrecv,
25 //skeletonAddress, rev);
26 TestClassComplete_Stub tcstub = new TestClassComplete_Stub(0, 0, portsend, portrecv, skeletonAddress, rev);
27 //byte[] in1 = { 68, 69 };
29 //byte[] in1 = new byte[counter];
30 //for (int i=0; i<counter; i++)
32 System.out.println("==== STRUCT ====");
33 Struct str = new Struct();
40 //byte[] returned = null;
43 //Struct strRes = null;
47 double inDouble = 1234.1234;
48 for (int i = 0; i < exp; i++) {
49 start = System.currentTimeMillis();
50 //start = System.nanoTime();
51 //System.out.println("Return value: " + Arrays.toString(tcstub.getByteArray(in1)));
52 //returned = tcstub.getByteArray(in1);
53 //strRes = tcstub.handleStruct(str);
54 //longVar = tcstub.getLong(inVar);
55 doubleVar = tcstub.getDouble(inDouble);
56 end = System.currentTimeMillis();
57 //end = System.nanoTime();
58 //long res = (end - start) / 1000;
59 long res = (end - start);
60 System.out.println("\n\n ==> Time: " + res);
61 //System.out.println("\n\n ==> Time: " + (end - start));
64 System.out.println("Average: " + (avg / exp));