Class MetricDumpSerialization.MetricSerializationResult

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    MetricDumpSerialization

    public static class MetricDumpSerialization.MetricSerializationResult
    extends Object
    implements Serializable
    This class encapsulates all serialized metrics and a count for each metric type.

    The counts are stored separately from the metrics since the final count for any given type can only be determined after all metrics of that type were serialized. Storing them together in a single byte[] would require an additional copy of all serialized metrics, as you would first have to serialize the metrics into a temporary buffer to calculate the counts, write the counts to the final output and copy all metrics from the temporary buffer.

    Note that while one could implement the serialization in such a way so that at least 1 byte (a validity flag) is written for each metric, this would require more bandwidth due to the sheer number of metrics.

    See Also:
    Serialized Form
    • Field Detail

      • serializedCounters

        public final byte[] serializedCounters
      • serializedGauges

        public final byte[] serializedGauges
      • serializedMeters

        public final byte[] serializedMeters
      • serializedHistograms

        public final byte[] serializedHistograms
      • numCounters

        public final int numCounters
      • numGauges

        public final int numGauges
      • numMeters

        public final int numMeters
      • numHistograms

        public final int numHistograms
    • Constructor Detail

      • MetricSerializationResult

        public MetricSerializationResult​(byte[] serializedCounters,
                                         byte[] serializedGauges,
                                         byte[] serializedMeters,
                                         byte[] serializedHistograms,
                                         int numCounters,
                                         int numGauges,
                                         int numMeters,
                                         int numHistograms)