Class ServerStatsEncoding
java.lang.Object
io.opencensus.common.ServerStatsEncoding
A service class to encode/decode
ServerStats as defined by the spec.
See opencensus-server-stats-specs
for encoding ServerStats
Use ServerStatsEncoding.toBytes(ServerStats stats) to encode.
Use ServerStatsEncoding.parseBytes(byte[] serialized) to decode.
- Since:
- 0.16
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
CURRENT_VERSION
public static final byte CURRENT_VERSIONThe current encoding version. The value is 0x0- Since:
- 0.16
- See Also:
-
-
Constructor Details
-
ServerStatsEncoding
private ServerStatsEncoding()
-
-
Method Details
-
toBytes
Encodes theServerStatsas per the Opencensus Summary Span specification.- Parameters:
stats-ServerStatsto encode.- Returns:
- encoded byte array.
- Since:
- 0.16
-
parseBytes
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
-