protected void symbolSeen(String symbol) {
// Note the paradigm here. We avoid any overlap by the .putIfAbsent call,
// but we really want to avoid excess garbage generation so we still do the .get
// first. The case where map won't be populated is extremely rare and only
// on startup.
Meter perSymbolMeter = _symbolStatistics.get(symbol);
if (perSymbolMeter == null) {
_metricsModificationLock.lock();
try {
perSymbolMeter = _symbolStatistics.get(symbol);
if (perSymbolMeter == null) {
perSymbolMeter = _detailedRegistry.meter(_metricNamePrefix + "." + symbol);
_symbolStatistics.put(symbol, perSymbolMeter);
}
} finally {
_metricsModificationLock.unlock();
}
}
perSymbolMeter.mark();
if (_tickMeter != null) {
_tickMeter.mark();
}
}