static int addTracingStatistic(TracingStatistic tracingStatistic) {
    // Check to see if we can enable the tracing statistic before actually
    // adding it.
    if (tracingStatistic.enable()) {
      // No synchronization needed, since this is a copy-on-write array.
      extraTracingStatistics.add(tracingStatistic);
      // 99.9% of the time, this will be O(1) and return
      // extraTracingStatistics.length - 1
      return extraTracingStatistics.lastIndexOf(tracingStatistic);
    } else {
      return -1;
    }
  }
static int addTracingStatistic ( TracingStatistic tracingStatistic ) { if ( tracingStatistic . enable ( ) ) { extraTracingStatistics . add ( tracingStatistic ) ; return extraTracingStatistics . lastIndexOf ( tracingStatistic ) ; } else { return - 1 ; } }
Adds a new tracing statistic to a trace

@param tracingStatistic to enable a run
@return The index of this statistic (for use with stat.extraInfo()), or
-1 if the statistic is not enabled.