Class MetricsCollectingMarshaller<T>
- java.lang.Object
-
- com.atlassian.confluence.impl.content.render.xhtml.analytics.MetricsCollectingMarshaller<T>
-
- All Implemented Interfaces:
Marshaller<T>
public class MetricsCollectingMarshaller<T> extends Object implements Marshaller<T>
AMarshaller
which delegates to another marshaller, whilst collecting metrics about the execution and streaming of that delegate.Metrics will onlty be collected if the executiuon and streaming do not throw exceptions. Exception conditions are likely to skew the metrics, and so will not be recorded.
- Since:
- 5.8
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> @NonNull Marshaller<T>
forMarshaller(MarshallerMetricsCollector metricsCollector, Marshaller<T> marshaller)
Creates an instrumented wrapper around another Marshaller which will gather execution metricsStreamable
marshal(T object, @Nullable ConversionContext conversionContext)
Marshals an object to XML.
-
-
-
Method Detail
-
forMarshaller
public static <T> @NonNull Marshaller<T> forMarshaller(MarshallerMetricsCollector metricsCollector, Marshaller<T> marshaller)
Creates an instrumented wrapper around another Marshaller which will gather execution metrics- Type Parameters:
T
- The type of the values being marshalled- Parameters:
metricsCollector
- The collector to usemarshaller
- The marshaller to be instrumented- Returns:
- The instrumented Marshaller
-
marshal
public Streamable marshal(T object, @Nullable ConversionContext conversionContext) throws XhtmlException
Description copied from interface:Marshaller
Marshals an object to XML.- Specified by:
marshal
in interfaceMarshaller<T>
- Parameters:
object
- object to marshalconversionContext
- the conversion context- Returns:
- the XML representation of the object
- Throws:
XhtmlException
- if an error occurs during marshalling
-
-