Class ServerStatsEncoding


  • public final class ServerStatsEncoding
    extends java.lang.Object
    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 
      Modifier and Type Field Description
      static byte CURRENT_VERSION
      The current encoding version.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ServerStatsEncoding()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ServerStats parseBytes​(byte[] serialized)
      Decodes serialized byte array to create ServerStats as per Opencensus Summary Span specification.
      static byte[] toBytes​(ServerStats stats)
      Encodes the ServerStats as per the Opencensus Summary Span specification.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • ServerStatsEncoding

        private ServerStatsEncoding()
    • Method Detail

      • toBytes

        public static byte[] toBytes​(ServerStats stats)
        Encodes the ServerStats as per the Opencensus Summary Span specification.
        Parameters:
        stats - ServerStats to encode.
        Returns:
        encoded byte array.
        Since:
        0.16