public static Timer newTimer(String name, String id, String... tags) { return Spectator.globalRegistry().timer(name, getTagsWithId(id, tags)); }
public static Timer newTimer(String name, String id, String... tags) { return Spectator.globalRegistry().timer(name, getTagsWithId(id, tags)); }
public static Timer newTimer(String name, String id, String... tags) { return Spectator.globalRegistry().timer(name, getTagsWithId(id, tags)); }
@Override public Meter get(Id id) { rlock.lock(); try { for (Registry r : registries) { Meter m = r.get(id); if (m != null) { if (m instanceof Counter) { return counter(id); } else if (m instanceof Timer) { return timer(id); } else if (m instanceof DistributionSummary) { return distributionSummary(id); } else if (m instanceof Gauge) { return gauge(id); } else { return null; } } } return null; } finally { rlock.unlock(); } }
@Override public Meter get(Id id) { rlock.lock(); try { for (Registry r : registries) { Meter m = r.get(id); if (m != null) { if (m instanceof Counter) { return counter(id); } else if (m instanceof Timer) { return timer(id); } else if (m instanceof DistributionSummary) { return distributionSummary(id); } else if (m instanceof Gauge) { return gauge(id); } else { return null; } } } return null; } finally { rlock.unlock(); } }
private void processGcEvent(GarbageCollectionNotificationInfo info) { GcEvent event = new GcEvent(info, jvmStartTime + info.getGcInfo().getStartTime()); gcLogs.get(info.getGcName()).add(event); if (LOGGER.isDebugEnabled()) { LOGGER.debug(event.toString()); } // Update pause timer for the action and cause... Id eventId = (isConcurrentPhase(info) ? CONCURRENT_PHASE_TIME : PAUSE_TIME) .withTag("action", info.getGcAction()) .withTag("cause", info.getGcCause()); Timer timer = Spectator.globalRegistry().timer(eventId); timer.record(info.getGcInfo().getDuration(), TimeUnit.MILLISECONDS); // Update promotion and allocation counters updateMetrics(info.getGcName(), info.getGcInfo()); // Notify an event listener if registered if (eventListener != null) { try { eventListener.onComplete(event); } catch (Exception e) { LOGGER.warn("exception thrown by event listener", e); } } }
private void processGcEvent(GarbageCollectionNotificationInfo info) { GcEvent event = new GcEvent(info, jvmStartTime + info.getGcInfo().getStartTime()); gcLogs.get(info.getGcName()).add(event); if (LOGGER.isDebugEnabled()) { LOGGER.debug(event.toString()); } // Update pause timer for the action and cause... Id eventId = (isConcurrentPhase(info) ? CONCURRENT_PHASE_TIME : PAUSE_TIME) .withTag("action", info.getGcAction()) .withTag("cause", info.getGcCause()); Timer timer = Spectator.globalRegistry().timer(eventId); timer.record(info.getGcInfo().getDuration(), TimeUnit.MILLISECONDS); // Update promotion and allocation counters updateMetrics(info.getGcName(), info.getGcInfo()); // Notify an event listener if registered if (eventListener != null) { try { eventListener.onComplete(event); } catch (Exception e) { LOGGER.warn("exception thrown by event listener", e); } } }