public TraceId getTraceId() { return TraceId.valueOf(traceId); }
public PersistedTrace(TraceId id, Time timestampValue, byte[] traceBytes) { this.traceId = id.toString(); this.timestamp = timestampValue; this.bytes = traceBytes; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TraceSummary other = (TraceSummary) obj; return other.id.equals(id); } }
@Override public void serialize(TraceId value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.writeString(value.getId()); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; }
@Override public void serialize(TraceId value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.writeString(value.getId()); } }
public TraceId getTraceId() { return TraceId.valueOf(traceIdStr); }
public PersistedTraceSummary getTraceSummary(TraceId id) { return entityManager.createNamedQuery(QUERY_SUMMARY_BY_TRACE_ID, PersistedTraceSummary.class) .setParameter("traceId", id.toString()) .getSingleResult(); }
public TraceId getTraceId() { return TraceId.valueOf(traceId); }
public TraceRegionKey(TraceId id, Time timestampValue) { this.traceId = id.toString(); this.timestamp = timestampValue.getNanos(); }
@Override public TraceId deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { String id = jp.getText(); return TraceId.valueOf(id); } }
private void addTraceIdResponseHeader(Response response, TraceId traceId) { response.addHeader("X-TraceId", traceId.toString()); try { // TODO make URL configurable response.addHeader("X-TraceUrl", "/insight/services/traces/" + URLEncoder.encode(traceId.toString(), response.getCharacterEncoding()) + "?type=json"); } catch (UnsupportedEncodingException e) { // ignore } }
@Override public TraceId deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { String id = jp.getText(); return TraceId.valueOf(id); } }
public PersistedTraceSummary(String traceLabel, TraceId traceId, TimeRange range, int errCount, String errText, Set<PersistedTag> tagSet, ServerName server, ApplicationName app, EndPointName endPoint) { this.label = (traceLabel.length() > 255) ? traceLabel.substring(0, 255) : traceLabel; this.serverName = server == null ? null : server.getName(); this.appName = app == null ? null : app.getName(); this.endpointName = endPoint == null ? null : endPoint.getName(); this.traceIdStr = traceId.toString(); this.rangeStart = range.getStart(); this.rangeEnd = range.getEnd(); this.responseTime = range.getDuration(); this.errorCount = errCount; this.errorText = errText; this.tags.addAll(tagSet); }
public static Trace makeTraceTree(String app, String path, String traceId, TestFrameCreator creator) { ApplicationName appKey = ApplicationName.valueOf(app); return Trace.newInstance(appKey, TraceId.valueOf(traceId), makeFrameTree(path, 1, 1000, 3, 3, creator)); }
public static Trace makeTrace(String app, String path, String traceId, TestFrameCreator creator) { ApplicationName appKey = ApplicationName.valueOf(app); return Trace.newInstance(appKey, TraceId.valueOf(traceId), creator.makeFrame(path)); }
public static Trace makeTrace(String app, String path, String traceId, TestFrameCreator creator, long durationMillis) { ApplicationName appKey = ApplicationName.valueOf(app); return Trace.newInstance(appKey, TraceId.valueOf(traceId), creator.makeFrame(path, durationMillis)); }
private int getSizeOfTraceRegionKey() { TraceRegionKey dummyKey = new TraceRegionKey(TraceId.valueOf(StringUtil.createStringOfLen(50)), Time.inDays(100)); return ObjectSizer.REFLECTION_SIZE.sizeof(dummyKey); } }