code: public static String getAllStats(OutputFormat format) {
  		StringBuilder sb = new StringBuilder();
  		boolean first = true;
  		
  		Collection<PerfStatEntry> stats = perfStats.get().values();
  		
  		switch (format) {
  		case JSON:
  			sb.append('{');
  			for (PerfStatEntry entry : stats) {
  				if (entry.count > 0) {
  					if (first) {
  						first = false;
  					} else {
  						sb.append(',');
  					}
  					sb.append('"').append(entry.name).append("\":");
  					if (entry.isErr)
  						sb.append("null");
  					else
  						sb.append(entry.total);
  				}
  			}
  			sb.append('}');
  			break;
  		default:
  			sb.append("[");
  			for (PerfStatEntry entry : stats) {
  				if (entry.count > 0) {
  					if (first) {
  						first = false;
  					} else {
  						sb.append(", ");
  					}
  					sb.append(entry.toString());
  				}
  			}			
  			sb.append("]");
  			break;
  		}
  		return sb.toString();
  	}
docs: Format all stats in the format specified.
  @param format serialization format
  @return serialized stats