- add some info logs for deskshare applet
This commit is contained in:
parent
ba16c09a02
commit
76e4d807d3
@ -51,6 +51,7 @@ public class BlockManager {
|
||||
numColumns = factory.getColumnCount();
|
||||
numRows = factory.getRowCount();
|
||||
int numberOfBlocks = numColumns * numRows;
|
||||
System.out.println("Sharing " + numberOfBlocks + " blocks [rows=" + numRows + ", cols=" + numColumns + "]");
|
||||
|
||||
for (int position = 1; position <= numberOfBlocks; position++) {
|
||||
Block block = factory.createBlock(position);
|
||||
|
@ -168,16 +168,30 @@ public class NetworkHttpStreamSender implements Runnable {
|
||||
if (message.getMessageType() == Message.MessageType.BLOCK) {
|
||||
long start = System.currentTimeMillis();
|
||||
Integer[] changedBlocks = ((BlockMessage)message).getBlocks();
|
||||
String blockSize = "Block length [";
|
||||
String encodeTime = "Encode times [";
|
||||
long encStart = 0;
|
||||
long encEnd = 0;
|
||||
int totalBytes = 0;
|
||||
long totalMillis = 0;
|
||||
for (int i = 0; i < changedBlocks.length; i++) {
|
||||
encStart = System.currentTimeMillis();
|
||||
EncodedBlockData block = retriever.getBlockToSend((Integer)changedBlocks[i]);
|
||||
totalBytes += block.getVideoData().length;
|
||||
blockSize += block.getVideoData().length + ",";
|
||||
encEnd = System.currentTimeMillis();
|
||||
totalMillis += (encEnd - encStart);
|
||||
encodeTime += (encEnd - encStart) + ",";
|
||||
BlockVideoData bv = new BlockVideoData(room, block.getPosition(), block.getVideoData(), false /* should remove later */);
|
||||
sendBlockData(bv);
|
||||
}
|
||||
System.out.println(blockSize + "] total=" + totalBytes + " bytes");
|
||||
System.out.println(encodeTime + "] total=" + totalMillis + " ms");
|
||||
for (int i = 0; i< changedBlocks.length; i++) {
|
||||
retriever.blockSent((Integer)changedBlocks[i]);
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
System.out.println("[HTTP tunnel] Sending " + changedBlocks.length + " blocks took " + (end - start) + " millis");
|
||||
System.out.println("[HTTP Thread " + id + "] Sending " + changedBlocks.length + " blocks took " + (end - start) + " millis");
|
||||
} else if (message.getMessageType() == Message.MessageType.CURSOR) {
|
||||
CursorMessage msg = (CursorMessage)message;
|
||||
sendCursor(msg.getMouseLocation(), msg.getRoom());
|
||||
|
@ -65,7 +65,7 @@ public class NetworkStreamSender implements NextBlockRetriever, NetworkStreamLis
|
||||
this.blockDim = blockDim;
|
||||
this.httpTunnel = httpTunnel;
|
||||
|
||||
numThreads = Runtime.getRuntime().availableProcessors();
|
||||
numThreads = Runtime.getRuntime().availableProcessors() * 2;
|
||||
System.out.println(NAME + "Starting up " + numThreads + " sender threads.");
|
||||
executor = Executors.newFixedThreadPool(numThreads);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user