Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
lkts committed Apr 17, 2024
1 parent d40d8eb commit a4516a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
* Contains metrics for operations involving source field.
*/
public class SourceFieldMetrics {
public static SourceFieldMetrics NOOP = new SourceFieldMetrics(MeterRegistry.NOOP, () -> 0);
public static final SourceFieldMetrics NOOP = new SourceFieldMetrics(MeterRegistry.NOOP, () -> 0);

public static final String SYNTHETIC_SOURCE_LOAD_LATENCY = "es.mapper.synthetic_source.load.latency.histogram";

private final LongSupplier relativeTimeSupplier;

private final LongHistogram synthethicSourceLoadLatency;
private final LongHistogram syntheticSourceLoadLatency;

public SourceFieldMetrics(MeterRegistry meterRegistry, LongSupplier relativeTimeSupplier) {
this.synthethicSourceLoadLatency = meterRegistry.registerLongHistogram(
this.syntheticSourceLoadLatency = meterRegistry.registerLongHistogram(
SYNTHETIC_SOURCE_LOAD_LATENCY,
"Time it takes to load fields and construct synthetic source",
"ms"
Expand All @@ -40,6 +40,6 @@ public LongSupplier getRelativeTimeSupplier() {
}

public void recordSyntheticSourceLoadLatency(TimeValue value) {
this.synthethicSourceLoadLatency.record(value.millis());
this.syntheticSourceLoadLatency.record(value.millis());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* Main purpose of this class is to avoid verbosity of passing individual metric instances around.
*/
public class MapperMetrics {
public static MapperMetrics NOOP = new MapperMetrics();

public static ValueWithThreadLocalOverride<SourceFieldMetrics> SOURCE_FIELD_METRICS = new ValueWithThreadLocalOverride<>(
SourceFieldMetrics.NOOP
);
Expand Down

0 comments on commit a4516a2

Please sign in to comment.