Package com.fayupable.logged.core.port
Class NoOpMetricsRecorder
java.lang.Object
com.fayupable.logged.core.port.NoOpMetricsRecorder
- All Implemented Interfaces:
MetricsRecorder
A no-op
MetricsRecorder that discards every invocation it is
asked to record.
This implementation exists so that the core module remains fully
usable on its own, without requiring any metrics backend (for example
Micrometer through logged-spring) on the classpath. Adapter modules are
expected to register their own MetricsRecorder implementation and
override this default; this class is the fallback when none is provided.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
NoOpMetricsRecorder
public NoOpMetricsRecorder()
-
-
Method Details
-
record
public void record(String className, String methodName, long durationNanos, boolean success, String exceptionType) Description copied from interface:MetricsRecorderRecords the outcome and duration of a single method invocation.- Specified by:
recordin interfaceMetricsRecorder- Parameters:
className- the simple or fully qualified name of the class declaring the invoked methodmethodName- the name of the invoked methoddurationNanos- the wall-clock duration of the invocation, in nanosecondssuccess-trueif the method returned normally,falseif it threw an exceptionexceptionType- the simple class name of the exception thrown by the method, ornullif the call succeeded
-