private void processLeaf(Component file, Path<FormulaExecutorComponentVisitor.Counters> path) {
   CounterInitializationContext counterContext = new CounterInitializationContextImpl(file);
   for (Formula formula : formulas) {
     Counter counter = formula.createNewCounter();
     counter.initialize(counterContext);
     for (String metricKey : formula.getOutputMetricKeys()) {
       addNewMeasure(file, metricKey, formula, counter);
     }
     aggregateToParent(path, formula, counter);
   }
 }
 private void processNotLeaf(
     Component component, Path<FormulaExecutorComponentVisitor.Counters> path) {
   for (Formula formula : formulas) {
     Counter counter = path.current().getCounter(formula);
     // If there were no file under this node, the counter won't be initialized
     if (counter != null) {
       for (String metricKey : formula.getOutputMetricKeys()) {
         addNewMeasure(component, metricKey, formula, counter);
       }
       aggregateToParent(path, formula, counter);
     }
   }
 }