CouchDbConnector db = null;
db = dbInstance.createConnector("orders", false);
OrderRepository or = new OrderRepository(db);
ViewResult result = null;
System.out.println("getValueSumByCountry");
System.out.println("times");
for(int i=0;i<10;++i){
long st = System.nanoTime();
result = or.valueSumByCountry();
System.out.print(((System.nanoTime()-st)/1000000.0)+";");
}
System.out.println("\n");
for(ViewResult.Row r : result.getRows()){
JsonNode key = r.getKeyAsNode();
JsonNode val = r.getValueAsNode();
// System.out.println("Country="+key.get(0)+", year="+key.get(1)+", sumValue="+val.getDoubleValue());
}
for(int i=0;i<10;++i){
long st = System.nanoTime();
List<Order> allOrders = or.getAllOrders();
Map<String,Map<String,Double>> data = new HashMap<>();
for(Order o : allOrders){
String country = o.getShipCountry();
String year = o.getShippedDate().substring(0, 4);
double valueSum = 0.0;