public void handleMetadataRecord(final TraceMetadata metadata) { final String hostname = metadata.getHostname(); final long traceId = metadata.getTraceId(); this.hostnameRepository.addEntry(traceId, hostname); }
/** * {@inheritDoc} */ @Override public void registerStrings(final IRegistry<String> stringRegistry) { // NOPMD (generated code) stringRegistry.get(this.getSessionId()); stringRegistry.get(this.getHostname()); } /**
this.trace.getTraceId(), this.trace.getSessionId(), this.trace.getHostname(), executionInformation.getEoi(), executionInformation.getEss(),
this.trace.getTraceId(), this.trace.getSessionId(), this.trace.getHostname(), executionInformation.getEoi(), executionInformation.getEss(),
final int cmpHostnames = t1.getTraceMetadata().getHostname().compareTo(t2.getTraceMetadata().getHostname()); if (cmpHostnames != 0) { return cmpHostnames;
final int cmpHostnames = t1.getTraceMetadata().getHostname() .compareTo(t2.getTraceMetadata().getHostname()); if (cmpHostnames != 0) { return cmpHostnames;
this.trace.getTraceId(), this.trace.getSessionId(), this.trace.getHostname(), executionInformation.getEoi(), executionInformation.getEss(),
/** * {@inheritDoc} */ @Override public int hashCode() { int code = 0; code += ((int)this.getTraceId()); code += ((int)this.getThreadId()); code += this.getSessionId().hashCode(); code += this.getHostname().hashCode(); code += ((int)this.getParentTraceId()); code += ((int)this.getParentOrderId()); code += ((int)this.getNextOrderId()); return code; }
this.trace.getTraceId(), this.trace.getSessionId(), this.trace.getHostname(), executionInformation.getEoi(), executionInformation.getEss(),
/** * {@inheritDoc} * * @deprecated since 1.13. Use {@link #serialize(IValueSerializer)} with an array serializer instead. */ @Override @Deprecated public Object[] toArray() { return new Object[] { this.getTraceId(), this.getThreadId(), this.getSessionId(), this.getHostname(), this.getParentTraceId(), this.getParentOrderId() }; } /**
/** * {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (obj == null) return false; if (obj == this) return true; if (obj.getClass() != this.getClass()) return false; final TraceMetadata castedRecord = (TraceMetadata) obj; if (this.getLoggingTimestamp() != castedRecord.getLoggingTimestamp()) return false; if (this.getTraceId() != castedRecord.getTraceId()) return false; if (this.getThreadId() != castedRecord.getThreadId()) return false; if (!this.getSessionId().equals(castedRecord.getSessionId())) return false; if (!this.getHostname().equals(castedRecord.getHostname())) return false; if (this.getParentTraceId() != castedRecord.getParentTraceId()) return false; if (this.getParentOrderId() != castedRecord.getParentOrderId()) return false; if (this.getNextOrderId() != castedRecord.getNextOrderId()) return false; return true; }
this.trace.getTraceId(), this.trace.getSessionId(), this.trace.getHostname(), executionInformation.getEoi(), executionInformation.getEss(),
this.trace.getTraceId(), this.trace.getSessionId(), this.trace.getHostname(), executionInformation.getEoi(), executionInformation.getEss(),
return false; if (!this.getHostname().equals(castedRecord.getHostname())) { return false;
public void handleBeforeOperationEventRecord(final BeforeOperationEvent record) { this.stack.push(record); final OperationCall newCall = this.factory.createOperationCall(); final Instant start = Instants.createFromEpochTimestamp(record.getTimestamp(), this.temporalUnit); newCall.setStart(start); final DeploymentContext context = this.deploymentModel.getDeploymentContexts().get(this.traceMetadata.getHostname()); final DeployedComponent component = context.getComponents().get(record.getClassSignature()); final DeployedOperation operation = component.getContainedOperations().get(record.getOperationSignature()); newCall.setOperation(operation); newCall.setOrderIndex(record.getOrderIndex()); newCall.setStackDepth(this.stack.size() - 1); if (this.root == null) { this.root = newCall; } else { this.current.getChildren().add(newCall); } this.current = newCall; }
/** * {@inheritDoc} */ @Override public void serialize(final IValueSerializer serializer) throws BufferOverflowException { serializer.putLong(this.getTraceId()); serializer.putLong(this.getThreadId()); serializer.putString(this.getSessionId()); serializer.putString(this.getHostname()); serializer.putLong(this.getParentTraceId()); serializer.putInt(this.getParentOrderId()); }
/** * {@inheritDoc} */ @Override public void serialize(final IValueSerializer serializer) throws BufferOverflowException { //super.serialize(serializer); serializer.putLong(this.getTraceId()); serializer.putLong(this.getThreadId()); serializer.putString(this.getSessionId()); serializer.putString(this.getHostname()); serializer.putLong(this.getParentTraceId()); serializer.putInt(this.getParentOrderId()); } /**
/** * Tests the constructor and toArray(..) methods of {@link TraceMetadata}. * * Assert that a record instance trace1 equals an instance event2 created by serializing trace1 to an array trace1Array * and using trace1Array to construct trace2. This ignores a set loggingTimestamp! */ @Test public void testSerializeDeserializeEquals() { final TraceMetadata trace1 = new TraceMetadata(TRACE_ID, THREAD_ID, SESSION_ID, HOSTNAME, PARENT_TRACE_ID, PARENT_ORDER_ID); Assert.assertEquals("Unexpected trace ID", TRACE_ID, trace1.getTraceId()); Assert.assertEquals("Unexpected thread ID", THREAD_ID, trace1.getThreadId()); Assert.assertEquals("Unexpected session ID", SESSION_ID, trace1.getSessionId()); Assert.assertEquals("Unexpected hostname", HOSTNAME, trace1.getHostname()); Assert.assertEquals("Unexpected parent trace ID", PARENT_TRACE_ID, trace1.getParentTraceId()); Assert.assertEquals("Unexpected parent order ID", PARENT_ORDER_ID, trace1.getParentOrderId()); }
/** * Tests the constructor and writeBytes(..) methods of {@link TraceMetadata}. */ @Test public void testSerializeDeserializeBinaryEquals() { final TraceMetadata trace1 = new TraceMetadata(TRACE_ID, THREAD_ID, SESSION_ID, HOSTNAME, PARENT_TRACE_ID, PARENT_ORDER_ID); Assert.assertEquals("Unexpected trace ID", TRACE_ID, trace1.getTraceId()); Assert.assertEquals("Unexpected thread ID", THREAD_ID, trace1.getThreadId()); Assert.assertEquals("Unexpected session ID", SESSION_ID, trace1.getSessionId()); Assert.assertEquals("Unexpected hostname", HOSTNAME, trace1.getHostname()); Assert.assertEquals("Unexpected parent trace ID", PARENT_TRACE_ID, trace1.getParentTraceId()); Assert.assertEquals("Unexpected parent order ID", PARENT_ORDER_ID, trace1.getParentOrderId()); final WriterListener receiver = new WriterListener(); final IWriterRegistry<String> stringRegistry = new WriterRegistry(receiver); final ByteBuffer buffer = ByteBuffer.allocate(trace1.getSize()); trace1.serialize(BinaryValueSerializer.create(buffer, stringRegistry)); buffer.flip(); final TraceMetadata trace2 = new TraceMetadata(BinaryValueDeserializer.create(buffer, receiver.getReaderRegistry())); Assert.assertEquals(trace1, trace2); Assert.assertEquals(0, trace1.compareTo(trace2)); } }