Changeset 38
- Timestamp:
- 04/17/08 01:04:15 (9 months ago)
- Location:
- trunk/src/planet
- Files:
-
- 2 modified
-
simulate/Results.java (modified) (2 diffs)
-
test/dht/DHTTest.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/planet/simulate/Results.java
r18 r38 219 219 * the lookup and insert times 220 220 */ 221 private static int lookup _number = 0;221 private static int lookupNumber = 0; 222 222 /** 223 223 * print total and average hops 224 224 */ 225 public static void print hops() {225 public static void printHops() { 226 226 Collection keys = hops.keySet(); 227 227 Iterator it = keys.iterator(); 228 long total _hops = 0;229 int lookup_number_temp = 0;228 long totalHops = 0; 229 int temp = 0; 230 230 while (it.hasNext()) { 231 lookup_number_temp++; 232 String id_and_source =(String)it.next(); 233 total_hops += ((Integer)(hops.get(id_and_source))).longValue(); 234 // System.out.println(id_and_source + " " + 235 // hops.get(id_and_source)); 236 237 } 238 239 lookup_number = lookup_number_temp; 231 temp++; 232 String idAndSource =(String)it.next(); 233 totalHops += ((Integer)(hops.get(idAndSource))).longValue(); 234 } 235 236 lookupNumber = temp; 240 237 Logger.log("************************", Logger.PRINT_LOG); 241 238 Logger.log("*****Hops Results*******", Logger.PRINT_LOG); 242 239 Logger.log("************************", Logger.PRINT_LOG); 243 if ( lookup_number_temp == 0) {240 if (temp == 0) { 244 241 Logger.log("There are no lookup operation", Logger.PRINT_LOG); 245 242 } else { 246 Logger.log("The total hops in the test is : [" + total _hops247 + "] in [" + lookup_number_temp + "] lookup operations",243 Logger.log("The total hops in the test is : [" + totalHops 244 + "] in [" + temp + "] lookup operations", 248 245 Logger.PRINT_LOG); 249 246 Logger.log("The average hops in the test is : " 250 + (double) ((double) total _hops / (double) lookup_number_temp),247 + (double) ((double) totalHops / (double) temp), 251 248 Logger.PRINT_LOG); 252 249 } … … 255 252 } 256 253 257 public static int getLookup _number() {258 return lookup _number;254 public static int getLookupNumber() { 255 return lookupNumber; 259 256 } 260 257 -
trunk/src/planet/test/dht/DHTTest.java
r34 r38 109 109 System.out.println ("Keys inserted with ["+steps+"] steps and ["+GenericApp.timeElapsedInSeconds(t1,t2)+"] seconds.\n"); 110 110 111 Results.print hops();112 int lookup_number_1 = Results.getLookup_number();111 Results.printHops(); 112 int lookupNumber1 = Results.getLookupNumber(); 113 113 //LOOKUP PROCESS 114 114 t1 = System.currentTimeMillis(); … … 128 128 System.out.println ("Key lookup finished with ["+steps+"] steps and ["+GenericApp.timeElapsedInSeconds(t1,t2)+"] seconds.\n"); 129 129 130 Results.print hops();131 int lookup_number_2 = Results.getLookup_number();132 System.out.println("loopup opertions is " + (lookup_number_2 - lookup_number_1));130 Results.printHops(); 131 int lookupNumber2 = Results.getLookupNumber(); 132 System.out.println("loopup opertions is " + (lookupNumber2 - lookupNumber1)); 133 133 134 134 //PRINT APPLICATON INFORMATION
