client = node.clientCore.makeClient((short) 0, false, false);
System.err.println("Inserting single block 3 times");
InsertBlock block = new InsertBlock(single, new ClientMetadata(), FreenetURI.EMPTY_CHK_URI);
FreenetURI uri = null;
int successes = 0;
for(int i=0;i<3;i++) {
System.err.println("Inserting single block, try #"+i);
try {
t1 = System.currentTimeMillis();
FreenetURI thisURI = client.insert(block, false, null);
if(uri != null && !thisURI.equals(uri)) {
System.err.println("URI "+i+" is "+thisURI+" but previous is "+uri);
System.exit(EXIT_DIFFERENT_URI);
}
uri = thisURI;
t2 = System.currentTimeMillis();
System.out.println("PUSH-TIME-" + i + ":" + (t2 - t1)+" for "+uri+" for single block");
csvLine.add(String.valueOf(t2 - t1));
csvLine.add(uri.toASCIIString());
successes++;
} catch (InsertException e) {
e.printStackTrace();
csvLine.add(InsertException.getShortMessage(e.getMode()));
csvLine.add("N/A");
System.out.println("INSERT FAILED: "+e+" for insert "+i+" for single block");
}
}
if(successes == 3)
System.err.println("All inserts succeeded for single block: "+successes);
else if(successes != 0)
System.err.println("Some inserts succeeded for single block: "+successes);
else
System.err.println("NO INSERTS SUCCEEDED FOR SINGLE BLOCK: "+successes);
uri = null;
// Insert 3 blocks
for(int i=0;i<3;i++) {
System.err.println("Inserting MHK #"+i);
uri = null;
block = new InsertBlock(mhks[i], new ClientMetadata(), FreenetURI.EMPTY_CHK_URI);
try {
t1 = System.currentTimeMillis();
FreenetURI thisURI = client.insert(block, false, null);
uri = thisURI;
t2 = System.currentTimeMillis();