diff options
6 files changed, 15 insertions, 14 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/android/ClientInterfaceBridge.java b/same-android/src/main/java/com/orbekk/same/android/ClientInterfaceBridge.java index 7da6c94..8195a28 100644 --- a/same-android/src/main/java/com/orbekk/same/android/ClientInterfaceBridge.java +++ b/same-android/src/main/java/com/orbekk/same/android/ClientInterfaceBridge.java @@ -55,7 +55,6 @@ public class ClientInterfaceBridge implements ClientInterface { class ResponseHandler extends Handler { @Override public synchronized void handleMessage(Message message) { - logger.info("ResponseHandler: Got here. Message: {}", message); if (serviceMessenger == null) { logger.warn("Ignoring message to disabled ResponseHandler."); return; @@ -68,7 +67,6 @@ public class ClientInterfaceBridge implements ClientInterface { break; case SameService.OPERATION_STATUS_CALLBACK: int operationNumber = message.arg1; - logger.info("Received callback for operation {}", operationNumber); int statusCode = message.getData().getInt("statusCode"); String statusMessage = message.getData().getString("statusMessage"); DelayedOperation.Status status = diff --git a/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java b/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java index bbd9031..171bb6b 100644 --- a/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java +++ b/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java @@ -141,7 +141,9 @@ public class SameControllerActivity extends Activity { channel = RpcChannel.create( SameService.DIRECTORY_HOST, SameService.DIRECTORY_PORT); } catch (UnknownHostException e) { - throw new RuntimeException(e); + logger.warn("Could not retrieve networks.", e); + e.printStackTrace(); + return; } catch (IOException e) { failedToast.show(); e.printStackTrace(); diff --git a/same-android/src/main/java/com/orbekk/same/android/SameService.java b/same-android/src/main/java/com/orbekk/same/android/SameService.java index 8d0d83c..21e0839 100644 --- a/same-android/src/main/java/com/orbekk/same/android/SameService.java +++ b/same-android/src/main/java/com/orbekk/same/android/SameService.java @@ -119,7 +119,6 @@ public class SameService extends Service { stateReceivers.remove(droppedMessenger); break; case SET_STATE: - logger.info("SET_STATE: oId: {}, comp: {}", message.arg1, message.obj); State.Component updatedComponent = new ComponentBundle(message.getData()).getComponent(); int id = message.arg1; @@ -133,7 +132,6 @@ public class SameService extends Service { default: super.handleMessage(message); } - logger.info("Finished handling message."); } } diff --git a/same-android/src/main/java/com/orbekk/same/android/benchmark/Experiment1Activity.java b/same-android/src/main/java/com/orbekk/same/android/benchmark/Experiment1Activity.java index 3e81147..862e007 100644 --- a/same-android/src/main/java/com/orbekk/same/android/benchmark/Experiment1Activity.java +++ b/same-android/src/main/java/com/orbekk/same/android/benchmark/Experiment1Activity.java @@ -46,7 +46,7 @@ public class Experiment1Activity extends Activity { private int warmupIterationsPerformed; private int iterationsPerformed; - private Timer timer; + private volatile Timer timer; private Variable<Integer> variable; @@ -74,13 +74,11 @@ public class Experiment1Activity extends Activity { RpcChannel channel = null; try { RpcCallback<Empty> done = new RpcCallback<Empty>() { - @Override public void run(Empty unused) { + @Override public void run(Empty response) { } }; channel = RpcChannel.create(Common.HOSTNAME, Common.PORT); Experiment1 exp1 = Experiment1.newStub(channel); - Rpc rpc = new Rpc(); - rpc.setTimeout(5000); int warmupIterationsLeft = WARMUP_ITERATIONS; for (Long sample : timer.getTimes()) { if (warmupIterationsLeft-- > 0) { @@ -90,9 +88,14 @@ public class Experiment1Activity extends Activity { .setTiming(sample) .setNumDevices(numDevices) .build(); + Rpc rpc = new Rpc(); + rpc.setTimeout(5000); exp1.registerSample(rpc, timing, done); + rpc.await(); + if (!rpc.isOk()) { + logger.warn(rpc.toString()); + } } - rpc.await(); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { @@ -104,6 +107,7 @@ public class Experiment1Activity extends Activity { channel.close(); } } + Toast.makeText(this, "Finished benchmark", Toast.LENGTH_LONG).show(); } /** Returns whether or not we should continue. */ @@ -139,8 +143,8 @@ public class Experiment1Activity extends Activity { variable.set(0); } - public void onStop() { - super.onStop(); + public void onPause() { + super.onStart(); client.disconnect(); } diff --git a/same/src/main/java/com/orbekk/same/Master.java b/same/src/main/java/com/orbekk/same/Master.java index 974f01c..815f12f 100644 --- a/same/src/main/java/com/orbekk/same/Master.java +++ b/same/src/main/java/com/orbekk/same/Master.java @@ -271,7 +271,6 @@ public class Master { @Override public void updateStateRequest(RpcController controller, Services.Component request, RpcCallback<Services.UpdateComponentResponse> done) { - logger.info("updateStateRequest({})", request); boolean success = false; if (state.checkRevision(request.getId(), request.getRevision())) { success = true; diff --git a/same/src/main/java/com/orbekk/same/SameController.java b/same/src/main/java/com/orbekk/same/SameController.java index 2dc31ed..80e5589 100644 --- a/same/src/main/java/com/orbekk/same/SameController.java +++ b/same/src/main/java/com/orbekk/same/SameController.java @@ -125,7 +125,7 @@ public class SameController { } public static SameController create(Configuration configuration) { - enableRpcLogging(); +// enableRpcLogging(); int pport = configuration.getInt("pport"); String myLocation = configuration.get("localIp") + ":" + pport; |