Class TracingInfo
- java.lang.Object
-
- org.glassfish.jersey.message.internal.TracingInfo
-
final class TracingInfo extends java.lang.ObjectCollects tracing messages for a request.- Since:
- 2.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTracingInfo.MessageA trace message.
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<TracingInfo.Message>messageList
-
Constructor Summary
Constructors Constructor Description TracingInfo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(TracingInfo.Message message)Add other tracing message.static java.lang.StringformatDuration(long duration)Format time duration in millis with accurate to 2 decimal places.static java.lang.StringformatDuration(long fromTimestamp, long toTimestamp)Format time duration in millis with accurate to 2 decimal places.static java.lang.StringformatPercent(long value, long top)Formatvaluefromtopvalue in percent with accurate to 2 decimal places.java.lang.String[]getMessages()Returns all collected messages enhanced by time duration data.
-
-
-
Field Detail
-
messageList
private final java.util.List<TracingInfo.Message> messageList
-
-
Method Detail
-
formatDuration
public static java.lang.String formatDuration(long duration)
Format time duration in millis with accurate to 2 decimal places.- Parameters:
duration- time duration in nanos- Returns:
- Formatted duration in millis.
-
formatDuration
public static java.lang.String formatDuration(long fromTimestamp, long toTimestamp)Format time duration in millis with accurate to 2 decimal places.- Parameters:
fromTimestamp- start of time interval in nanostoTimestamp- end of time interval in nanos- Returns:
- Formatted duration in millis.
-
formatPercent
public static java.lang.String formatPercent(long value, long top)Formatvaluefromtopvalue in percent with accurate to 2 decimal places.- Parameters:
value- part value according to toptop- 100% value- Returns:
- Formatted value in percent.
-
getMessages
public java.lang.String[] getMessages()
Returns all collected messages enhanced by time duration data.- Returns:
- all formatted messages
-
addMessage
public void addMessage(TracingInfo.Message message)
Add other tracing message.- Parameters:
message- tracing message.
-
-