public CommonStats getTotal() {
   if (total != null) {
     return total;
   }
   CommonStats stats = new CommonStats();
   for (ShardStats shard : shards) {
     stats.add(shard.getStats());
   }
   total = stats;
   return stats;
 }
 public CommonStats getPrimary() {
   if (primary != null) {
     return primary;
   }
   CommonStats stats = new CommonStats();
   for (ShardStats shard : shards) {
     if (shard.getShardRouting().primary()) {
       stats.add(shard.getStats());
     }
   }
   primary = stats;
   return stats;
 }