@Test public void typical() { deletedMetadataReporter.reportTaggable(taggable, HIVE_TABLE); Counter counter = RequiredSearch.in(meterRegistry).name(tableCounterName).tags("table", TABLE).counter(); assertThat(counter).isNotNull(); assertThat(counter.measure().iterator()).toIterable().extracting("statistic").containsExactly(Statistic.COUNT); assertThat(counter.measure().iterator()).toIterable().extracting("value").containsExactly((double) 1); }
public void reportTaggable(Taggable taggable, MetadataType metadataType) { log.info("Deleted " + metadataType.getTypeName()); MetricTag tag = taggable.getMetricTag(); String metadataMetricName = String.join("-", metadataType.getTypeName(), metricName); Counter counter = Counter.builder(metadataMetricName).tags(createTag(tag)).register(meterRegistry); counter.increment(); }
DeletedMetadataReporter { public void reportTaggable(Taggable taggable, MetadataType metadataType) { log.info("Deleted " + metadataType.getTypeName()); MetricTag tag = taggable.getMetricTag(); String metadataMetricName = String.join("-", metadataType.getTypeName(), metricName); Counter counter = Counter.builder(metadataMetricName).tags(createTag(tag)).register(meterRegistry); counter.increment(); } }
DeletedMetadataReporter { public void reportTaggable(Taggable taggable, MetadataType metadataType) { log.info("Deleted " + metadataType.getTypeName()); MetricTag tag = taggable.getMetricTag(); String metadataMetricName = String.join("-", metadataType.getTypeName(), metricName); Counter counter = Counter.builder(metadataMetricName).tags(createTag(tag)).register(meterRegistry); counter.increment(); } DeletedMetadataReporter(MeterRegistry meterRegistry, boolean dryRunEnabled); }
DeletedMetadataReporter { public void reportTaggable(Taggable taggable, MetadataType metadataType) { log.info("Deleted " + metadataType.getTypeName()); MetricTag tag = taggable.getMetricTag(); String metadataMetricName = String.join("-", metadataType.getTypeName(), metricName); Counter counter = Counter.builder(metadataMetricName).tags(createTag(tag)).register(meterRegistry); counter.increment(); } DeletedMetadataReporter(MeterRegistry meterRegistry, boolean dryRunEnabled); void reportTaggable(Taggable taggable, MetadataType metadataType); }
DeletedMetadataReporter { public void reportTaggable(Taggable taggable, MetadataType metadataType) { log.info("Deleted " + metadataType.getTypeName()); MetricTag tag = taggable.getMetricTag(); String metadataMetricName = String.join("-", metadataType.getTypeName(), metricName); Counter counter = Counter.builder(metadataMetricName).tags(createTag(tag)).register(meterRegistry); counter.increment(); } DeletedMetadataReporter(MeterRegistry meterRegistry, boolean dryRunEnabled); void reportTaggable(Taggable taggable, MetadataType metadataType); static final String METRIC_NAME; static final String DRY_RUN_METRIC_NAME; }