public static class MetricDumpSerialization.MetricSerializationResult extends Object implements Serializable
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.
Modifier and Type | Field and Description |
---|---|
int |
numCounters |
int |
numGauges |
int |
numHistograms |
int |
numMeters |
byte[] |
serializedCounters |
byte[] |
serializedGauges |
byte[] |
serializedHistograms |
byte[] |
serializedMeters |
Constructor and Description |
---|
MetricSerializationResult(byte[] serializedCounters,
byte[] serializedGauges,
byte[] serializedMeters,
byte[] serializedHistograms,
int numCounters,
int numGauges,
int numMeters,
int numHistograms) |
public final byte[] serializedCounters
public final byte[] serializedGauges
public final byte[] serializedMeters
public final byte[] serializedHistograms
public final int numCounters
public final int numGauges
public final int numMeters
public final int numHistograms
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.