Show log trace with wavelet snapshots size Project: http://git-wip-us.apache.org/repos/asf/incubator-wave/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-wave/commit/0c21d4e7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-wave/tree/0c21d4e7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-wave/diff/0c21d4e7
Branch: refs/heads/swellrt Commit: 0c21d4e7b8e7936fe2d99ca44cd53d8aa18a08ad Parents: 94fa187 Author: Pablo Ojanguren <[email protected]> Authored: Mon Oct 17 19:07:58 2016 +0200 Committer: Pablo Ojanguren <[email protected]> Committed: Mon Oct 17 19:07:58 2016 +0200 ---------------------------------------------------------------------- .../box/server/rpc/WebSocketChannel.java | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/0c21d4e7/wave/src/main/java/org/waveprotocol/box/server/rpc/WebSocketChannel.java ---------------------------------------------------------------------- diff --git a/wave/src/main/java/org/waveprotocol/box/server/rpc/WebSocketChannel.java b/wave/src/main/java/org/waveprotocol/box/server/rpc/WebSocketChannel.java index 3bc8cf3..e4413fc 100644 --- a/wave/src/main/java/org/waveprotocol/box/server/rpc/WebSocketChannel.java +++ b/wave/src/main/java/org/waveprotocol/box/server/rpc/WebSocketChannel.java @@ -19,25 +19,24 @@ package org.waveprotocol.box.server.rpc; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.google.gson.JsonPrimitive; -import com.google.protobuf.Message; +import java.io.IOException; +import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolWaveletUpdate; import org.waveprotocol.box.server.rpc.ProtoSerializer.SerializationException; +import org.waveprotocol.box.stat.SessionContext; +import org.waveprotocol.box.stat.Timer; +import org.waveprotocol.box.stat.Timing; import org.waveprotocol.wave.communication.gson.GsonException; import org.waveprotocol.wave.communication.gson.GsonSerializable; import org.waveprotocol.wave.model.wave.ParticipantId; import org.waveprotocol.wave.util.logging.Log; -import java.io.IOException; -import java.nio.charset.Charset; - -import org.waveprotocol.box.stat.SessionContext; -import org.waveprotocol.box.stat.Timer; -import org.waveprotocol.box.stat.Timing; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.JsonPrimitive; +import com.google.protobuf.Message; /** * A channel abstraction for websocket, for sending and receiving strings. @@ -157,8 +156,10 @@ public abstract class WebSocketChannel extends MessageExpectingChannel { json = serializer.toJson(message); String type = message.getDescriptorForType().getName(); str = MessageWrapper.serialize(type, sequenceNo, json); - if (sequenceNo == 1) { - LOG.info("First response size is "+ (str.length() * 2) + " bytes "); + if (message instanceof ProtocolWaveletUpdate) { + ProtocolWaveletUpdate updateMessage = (ProtocolWaveletUpdate) message; + if (updateMessage.hasSnapshot()) + LOG.info("snaphost size is "+(str.length() *2)+" bytes"); } } catch (SerializationException e) { LOG.warning("Failed to JSONify proto message", e);
