@Override public String toString() { if (getSnapshotCount() > 0) { return super.toString() + "," + getSnapshots(); } else { return super.toString(); } } }
private void reportActivity(TrackingActivity activity) throws IOException, URISyntaxException { try { if (!eventSink.isOpen()) { eventSink.open(); } } finally { if (!activity.isStopped()) { activity.stop(); } eventSink.log(activity); snapCount.addAndGet(activity.getSnapshotCount()); activityCount.incrementAndGet(); } }
msg.append("id-count: '").append(activity.getIdCount()).append("'"); if (activity.getSnapshotCount() > 0) { msg.append(separator); msg.append("snap-count: '").append(activity.getSnapshotCount()).append("'"); msg.append("guid: '").append(activity.getGUID()).append("'"); if (activity.getSnapshotCount() > 0) { msg.append(separator); Collection<Snapshot> snapshots = activity.getSnapshots();
@Override public void log(TrackingActivity activity) { _checkState(); boolean doLog = filterCheck ? isLoggable(activity) : true; if (doLog) { try { if (!_limiter(1, 512)) { return; } if (ttl != TTL.TTL_CONTEXT) { activity.setTTL(ttl); } _log(activity); loggedActivities.incrementAndGet(); loggedSnaps.addAndGet(activity.getSnapshotCount()); lastTime.set(System.currentTimeMillis()); errorState = false; if (!logListeners.isEmpty()) { notifyListeners(new SinkLogEvent(this, activity)); } } catch (Throwable ex) { notifyListeners(new SinkLogEvent(this, activity), ex); } } }
.append(itemsToJSON(getProperties(activity))).append(ARRAY_END); if (activity.getSnapshotCount() > 0) { jsonString.append(JSON_SNAPSHOTS_LABEL).append(ATTR_SEP).append(ARRAY_START_JSON) .append(itemsToJSON(getSnapshots(activity))).append(ARRAY_END);
jsonString.append(JSON_SNAPSHOT_COUNT_LABEL).append(ATTR_SEP).append(activity.getSnapshotCount()) .append(ATTR_JSON); jsonString.append(JSON_PROPERTY_COUNT_LABEL).append(ATTR_SEP).append(activity.getPropertyCount()); .append(itemsToJSON(activity.getProperties())).append(ARRAY_END); if (activity.getSnapshotCount() > 0) { jsonString.append(ATTR_JSON); jsonString.append(JSON_SNAPSHOTS_LABEL).append(ATTR_SEP).append(ARRAY_START_JSON)