Class RequestTraceSpan
- java.lang.Object
-
- fish.payara.notification.requesttracing.RequestTraceSpan
-
- All Implemented Interfaces:
Serializable
,Comparable<RequestTraceSpan>
public class RequestTraceSpan extends Object implements Serializable, Comparable<RequestTraceSpan>
- Author:
- mertcaliskan Event class that stores traced values.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RequestTraceSpan.SpanContextRelationshipType
class
RequestTraceSpan.SpanReference
-
Constructor Summary
Constructors Modifier Constructor Description protected
RequestTraceSpan()
RequestTraceSpan(EventType eventType, String eventName)
RequestTraceSpan(EventType eventType, String eventName, UUID propagatedTraceId, UUID propagatedParentId, RequestTraceSpan.SpanContextRelationshipType spanContextRelationship)
RequestTraceSpan(String eventName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSpanLog(RequestTraceSpanLog spanLog)
void
addSpanReference(RequestTraceSpanContext spanContext, RequestTraceSpan.SpanContextRelationshipType relationshipType)
void
addSpanTag(io.opentracing.tag.Tag tag, String value)
Adds more information about a spanvoid
addSpanTag(String name, String value)
Adds more information about a spanint
compareTo(RequestTraceSpan span)
String
getEventName()
EventType
getEventType()
UUID
getId()
RequestTraceSpanContext
getSpanContext()
long
getSpanDuration()
Gets the elapsed time since the current request trace has startedList<RequestTraceSpan.SpanReference>
getSpanReferences()
String
getSpanTag(Object tag)
Map<Object,String>
getSpanTags()
Instant
getStartInstant()
long
getTimeOccured()
Gets the time in milliseconds since the epoch (midnight, January 1st 1970) when the the request event occurred.Instant
getTraceEndTime()
UUID
getTraceId()
void
setEventName(String eventName)
void
setEventType(EventType spanType)
void
setSpanDuration(long spanTime)
Sets the elapsed time since the current request trace has startedvoid
setStartInstant(Instant startTime)
void
setTraceEndTime(Instant endTime)
void
setTraceId(UUID traceId)
String
toString()
-
-
-
Constructor Detail
-
RequestTraceSpan
protected RequestTraceSpan()
-
RequestTraceSpan
public RequestTraceSpan(String eventName)
-
RequestTraceSpan
public RequestTraceSpan(EventType eventType, String eventName, UUID propagatedTraceId, UUID propagatedParentId, RequestTraceSpan.SpanContextRelationshipType spanContextRelationship)
-
-
Method Detail
-
getId
public UUID getId()
-
getTraceId
public UUID getTraceId()
-
setTraceId
public void setTraceId(UUID traceId)
-
getSpanContext
public RequestTraceSpanContext getSpanContext()
-
getStartInstant
public Instant getStartInstant()
-
setStartInstant
public void setStartInstant(Instant startTime)
-
getTimeOccured
public long getTimeOccured()
Gets the time in milliseconds since the epoch (midnight, January 1st 1970) when the the request event occurred.- Returns:
- the time the trace occurred
-
getSpanDuration
public long getSpanDuration()
Gets the elapsed time since the current request trace has started- Returns:
- nanoseconds since the current request trace has started.
-
setSpanDuration
public void setSpanDuration(long spanTime)
Sets the elapsed time since the current request trace has started- Parameters:
spanTime
- Nanoseconds since the current request trace has started
-
getEventType
public EventType getEventType()
-
getEventName
public String getEventName()
-
setEventName
public void setEventName(String eventName)
-
addSpanTag
public void addSpanTag(String name, String value)
Adds more information about a span- Parameters:
name
-value
-
-
addSpanTag
public void addSpanTag(io.opentracing.tag.Tag tag, String value)
Adds more information about a span- Parameters:
tag
-value
-
-
addSpanLog
public void addSpanLog(RequestTraceSpanLog spanLog)
-
addSpanReference
public void addSpanReference(RequestTraceSpanContext spanContext, RequestTraceSpan.SpanContextRelationshipType relationshipType)
-
getSpanReferences
public List<RequestTraceSpan.SpanReference> getSpanReferences()
-
getTraceEndTime
public Instant getTraceEndTime()
-
setTraceEndTime
public void setTraceEndTime(Instant endTime)
-
setEventType
public void setEventType(EventType spanType)
-
compareTo
public int compareTo(RequestTraceSpan span)
- Specified by:
compareTo
in interfaceComparable<RequestTraceSpan>
-
-