@Override public String newUUID() { return newUUID(tConfig); }
@Override public String newUUID(Object obj) { return newUUID(tConfig, obj); }
protected TrackerImpl(TrackerConfig config, boolean keepContext) { if (!config.isBuilt()) { throw new IllegalArgumentException("Uninitialized tracker configuration: use config.build()"); } this.keepContext = keepContext; this.tConfig = config; this.id = newUUID(); this.selector = tConfig.getTrackingSelector(); this.eventSink = tConfig.getEventSink(); open(); }
/** * Creates a logical application activity object with the specified signature. * * @param level * activity severity level * @param name * activity name * @param trk * {@link Tracker} instance associated with this activity * @throws NullPointerException * if the signature is {@code null} * @throws IllegalArgumentException * if the signature is empty or is too long * @see #setTrackingId(String) */ protected TrackingActivity(OpLevel level, String name, TrackerImpl trk) { super(trk.newUUID(), name, trk.getSource()); tracker = trk; setSeverity(level); setLocation(trk.getSource()); }
@Override public TrackingActivity newActivity(OpLevel level, String name, String signature) { long start = System.nanoTime(); try { if (!isTrackingEnabled(level, name, signature)) { return NULL_ACTIVITY; } signature = (signature == null) ? newUUID() : signature; TrackingActivity activity = new TrackingActivity(level, name, signature, this); activity.setPID(Utils.getVMPID()); if (tConfig.getActivityListener() != null) { activity.addActivityListener(tConfig.getActivityListener()); } return activity; } finally { countOverheadNanos(System.nanoTime() - start); } }