Package io.opencensus.common
Class ServerStatsEncoding
- java.lang.Object
-
- io.opencensus.common.ServerStatsEncoding
-
public final class ServerStatsEncoding extends java.lang.ObjectA service class to encode/decodeServerStatsas defined by the spec.See opencensus-server-stats-specs for encoding
ServerStatsUse
ServerStatsEncoding.toBytes(ServerStats stats)to encode.Use
ServerStatsEncoding.parseBytes(byte[] serialized)to decode.- Since:
- 0.16
-
-
Field Summary
Fields Modifier and Type Field Description static byteCURRENT_VERSIONThe current encoding version.
-
Constructor Summary
Constructors Modifier Constructor Description privateServerStatsEncoding()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ServerStatsparseBytes(byte[] serialized)Decodes serialized byte array to createServerStatsas per Opencensus Summary Span specification.static byte[]toBytes(ServerStats stats)Encodes theServerStatsas per the Opencensus Summary Span specification.
-
-
-
Field Detail
-
CURRENT_VERSION
public static final byte CURRENT_VERSION
The current encoding version. The value is 0- Since:
- 0.16
- See Also:
- Constant Field Values
-
-
Method Detail
-
toBytes
public static byte[] toBytes(ServerStats stats)
Encodes theServerStatsas per the Opencensus Summary Span specification.- Parameters:
stats-ServerStatsto encode.- Returns:
- encoded byte array.
- Since:
- 0.16
-
parseBytes
public static ServerStats parseBytes(byte[] serialized) throws ServerStatsDeserializationException
Decodes serialized byte array to createServerStatsas per Opencensus Summary Span specification.- Parameters:
serialized- encodedServerStatsin byte array.- Returns:
- decoded
ServerStats. null if decoding fails. - Throws:
ServerStatsDeserializationException- Since:
- 0.16
-
-