@Override public String toString() { OpType type = getType(); String res = getResource(); UsecTimestamp sTime = getStartTime(); UsecTimestamp eTime = getEndTime(); StringBuilder str = new StringBuilder(); str.append(getClass().getSimpleName()).append("{").append("Name:").append(getName()).append(",").append("Type:") .append(type == null ? "null" : type.toString()).append(",").append("Correlator:") .append(getCorrelator()).append(",").append("Location:").append(getLocation()).append(",") .append("Resource:").append(res == null ? "null" : res).append(",").append("User:").append(getUser()) .append(",").append("SnapCount=").append(getSnapshotCount()).append(",").append("PropCount=") .append(getPropertyCount()).append(",").append("CompCode:").append(getCompCode()).append(",") .append("ReasonCode:").append(getReasonCode()).append(",").append("PID:").append(getPID()).append(",") .append("TID:").append(getTID()).append(",").append("ElapsedUsec:").append(getElapsedTimeUsec()) .append(",").append("WaitUsec:").append(getWaitTimeUsec()).append(",").append("WallUsec:") .append(getWallTimeUsec()).append(",").append("StartTime:[").append(sTime.toString()).append("],") .append("EndTime:[").append(eTime.toString()).append("],").append("Exception:") .append(getExceptionString()).append("}"); return str.toString(); }
msg.append("prop-count: '").append(event.getOperation().getPropertyCount()).append("'"); if (event.getOperation().getSnapshotCount() > 0) { msg.append(separator); msg.append("snap-count: '").append(event.getOperation().getSnapshotCount()).append("'"); msg.append("\n\t}"); if (event.getOperation().getSnapshotCount() > 0) { Collection<Snapshot> snapshots = event.getOperation().getSnapshots(); for (Snapshot snap : snapshots) {
@Override public void log(TrackingEvent event) { _checkState(); boolean doLog = filterCheck ? isLoggable(event) : true; if (doLog) { try { if (!_limiter(1, event.getSize())) { return; } if (ttl != TTL.TTL_CONTEXT) { event.setTTL(ttl); } _log(event.sign()); loggedEvents.incrementAndGet(); loggedSnaps.addAndGet(event.getOperation().getSnapshotCount()); lastTime.set(System.currentTimeMillis()); errorState = false; if (!logListeners.isEmpty()) { notifyListeners(new SinkLogEvent(this, event)); } } catch (Throwable ex) { notifyListeners(new SinkLogEvent(this, event), ex); } } }
int snapCount = event.getOperation().getSnapshotCount(); int propCount = event.getOperation().getPropertyCount();
int snapCount = event.getOperation().getSnapshotCount(); int propCount = event.getOperation().getPropertyCount(); jsonString.append(JSON_SNAPSHOT_COUNT_LABEL).append(ATTR_SEP).append(snapCount).append(ATTR_JSON);
private Snapshot getSelfSnapshot(Operation op) { Snapshot selfSnapshot = new PropertySnapshot("Self"); if (op.getCorrelator() != null) { Set<String> cids = op.getCorrelator(); if (!cids.isEmpty()) { selfSnapshot.add(JSON_CORR_ID_FIELD, cids); } } if (op.getUser() != null) { selfSnapshot.add(JSON_USER_FIELD, op.getUser()); } if (op.getLocation() != null) { selfSnapshot.add(JSON_LOCATION_FIELD, op.getLocation()); } selfSnapshot.add(JSON_SEVERITY_FIELD, op.getSeverity()); selfSnapshot.add(JSON_PID_FIELD, op.getPID()); selfSnapshot.add(JSON_TID_FIELD, op.getTID()); selfSnapshot.add(JSON_SNAPSHOT_COUNT_FIELD, op.getSnapshotCount()); selfSnapshot.add(JSON_ELAPSED_TIME_USEC_FIELD, op.getElapsedTimeUsec()); return selfSnapshot; }