Class DiagnosticRuntimeMetricDao
java.lang.Object
io.higson.runtime.dao.BaseDao
io.higson.runtime.diagnostic.metrics.DiagnosticRuntimeMetricDao
- Direct Known Subclasses:
SnapshotDiagnosticRuntimeMetricDao
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHi-lo allocation size — onenextval()reserves this many ids locally.static final String -
Constructor Summary
ConstructorsConstructorDescriptionDiagnosticRuntimeMetricDao(DataSource dataSource, ConnectionInterceptor connectionInterceptor) -
Method Summary
Modifier and TypeMethodDescriptionvoidsave(DiagnosticRuntimeMetric metrics) voidsaveBatch(List<DiagnosticRuntimeMetric> metricsList)
-
Field Details
-
SEQUENCE_NAME
- See Also:
-
SEQUENCE_ALLOCATION_SIZE
public static final int SEQUENCE_ALLOCATION_SIZEHi-lo allocation size — onenextval()reserves this many ids locally. The underlyingSEQUENCE_NAMEsequence is declared withINCREMENT BY 1(MPP-10221 changelog) so the generator multiplies the fetched value by this size to derive the local id buffer.MySQL note: MySQL has no native sequences, so the
seq_diagnostic_runtime_metric"sequence" is emulated via a single-row table read by stored procedureseq_next_id(MPP-4912). That procedure hard-codesnext_val += 50per call, so on MySQL the values returned are1, 51, 101, ...regardless of the changelog'sincrementBy. With the classic hi-lo formulamin = unique * allocationSizethis produces sparse but collision-free buffers ([50..99],[2550..2599], ...). Acceptable for diagnostic data; if dense ids on MySQL are required, a dedicated MySQL-specific stored procedure withincrement = 1would have to be introduced.- See Also:
-
-
Constructor Details
-
DiagnosticRuntimeMetricDao
public DiagnosticRuntimeMetricDao(DataSource dataSource, ConnectionInterceptor connectionInterceptor)
-
-
Method Details
-
save
-
saveBatch
-