public static class MetricDumpSerialization.MetricDumpSerializer extends Object
MetricDumpSerialization.MetricSerializationResult
.Constructor and Description |
---|
MetricDumpSerializer() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
MetricDumpSerialization.MetricSerializationResult |
serialize(Map<Counter,Tuple2<QueryScopeInfo,String>> counters,
Map<Gauge<?>,Tuple2<QueryScopeInfo,String>> gauges,
Map<Histogram,Tuple2<QueryScopeInfo,String>> histograms,
Map<Meter,Tuple2<QueryScopeInfo,String>> meters)
Serializes the given metrics and returns the resulting byte array.
|
public MetricDumpSerialization.MetricSerializationResult serialize(Map<Counter,Tuple2<QueryScopeInfo,String>> counters, Map<Gauge<?>,Tuple2<QueryScopeInfo,String>> gauges, Map<Histogram,Tuple2<QueryScopeInfo,String>> histograms, Map<Meter,Tuple2<QueryScopeInfo,String>> meters)
Should a Metric
accessed in this method throw an exception it will be omitted
from the returned MetricDumpSerialization.MetricSerializationResult
.
If the serialization of any primitive or String fails then the returned MetricDumpSerialization.MetricSerializationResult
is partially corrupted. Such a result can be deserialized
safely by MetricDumpDeserializer#deserialize(MetricSerializationResult)
; however
only metrics that were fully serialized before the failure will be returned.
counters
- counters to serializegauges
- gauges to serializehistograms
- histograms to serializepublic void close()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.