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 ; } }
Adds a new tracing statistic to a trace