GRPCExporter extends MetricFormatter implements MetricValuesExportService, IConsumer<ExportData> { @Override public void export(ExportEvent event) { if (ExportEvent.EventType.TOTAL == event.getType()) { Metrics metrics = event.getMetrics(); if (metrics instanceof WithMetadata) { MetricsMetaInfo meta = ((WithMetadata) metrics).getMeta(); if (subscriptionSet.size() == 0 || subscriptionSet.contains(meta.getMetricsName())) { exportBuffer.produce(new ExportData(meta, metrics)); } } } } GRPCExporter(GRPCExporterSetting setting); @Override void export(ExportEvent event); void initSubscriptionList(); @Override void init(); @Override void consume(List<ExportData> data); @Override void onError(List<ExportData> data, Throwable t); @Override void onExit();  }
@Test public void export() { ExportEvent event = new ExportEvent(new MockExporterMetrics(), ExportEvent.EventType.TOTAL); exporter.export(event); }