Interface DiagnosticEventPersister<T extends DiagnosticData>
- Type Parameters:
T- concreteDiagnosticDatapayload type handled by this persister
- All Known Implementing Classes:
CallStackReportDiagnosticEventPersister,RuntimeMetricsDiagnosticEventPersister,ThreadStateSnapshotDiagnosticEventPersister
public interface DiagnosticEventPersister<T extends DiagnosticData>
Strategy for persisting
DiagnosticEvents of a single DiagnosticEventCode.
A single implementation supports exactly one event code. Adding support for a new event code is done by providing a new implementation and registering it with the flush watcher.
The default persist(List) flow filters the incoming batch by dataType(),
logs the count + event code, and delegates a typed list to saveBatch(List).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondataType()The payload class this persister handles.default voidpersist(List<DiagnosticEvent> events) Persist a batch of events.voidBatch-insert the type-safe payloads into the underlying store.The event code this persister handles.
-
Field Details
-
log
static final org.slf4j.Logger log
-
-
Method Details
-
supportedCode
DiagnosticEventCode supportedCode()The event code this persister handles. -
dataType
The payload class this persister handles. Used by the defaultpersist(List)to filter the incoming batch. -
saveBatch
Batch-insert the type-safe payloads into the underlying store.- Parameters:
items- items to persist; nevernullor empty
-
persist
Persist a batch of events. All events in the list are guaranteed to havesupportedCode()as their event code; events whose payload does not matchdataType()are skipped.
-