code: public static void registerStatistics(String category, Statistics global, Map<String, Statistics> allStatistics)
     {
        if (category == null || category.length() == 0)
        {
           throw new IllegalArgumentException("The category of the statistics cannot be empty");
        }
        if (allStatistics == null || allStatistics.isEmpty())
        {
           throw new IllegalArgumentException("The list of statistics " + category + " cannot be empty");
        }
        PrintWriter pw = null;
        if (PERSISTENCE_ENABLED)
        {
           pw = initWriter(category);
           if (pw == null)
           {
              LOG.warn("Cannot create the print writer for the statistics " + category);
           }
        }
        startIfNeeded();
        synchronized (JCRStatisticsManager.class)
        {
           Map<String, StatisticsContext> tmpContexts = new HashMap<String, StatisticsContext>(CONTEXTS);
           StatisticsContext ctx = new StatisticsContext(pw, global, allStatistics);
           tmpContexts.put(category, ctx);
           if (pw != null)
           {
              // Define the file header
              printHeader(ctx);
           }
           CONTEXTS = Collections.unmodifiableMap(tmpContexts);
        }
     }
docs: Register a new category of statistics to manage.
  @param category the name of the category of statistics to register.
  @param global the global statistics.
  @param allStatistics the list of all statistics corresponding to the category.