wu-sheng commented on a change in pull request #6602:
URL: https://github.com/apache/skywalking/pull/6602#discussion_r599522473
##########
File path:
oap-server/exporter/src/main/java/org/apache/skywalking/oap/server/exporter/provider/grpc/GRPCExporter.java
##########
@@ -67,27 +73,52 @@ public GRPCExporter(GRPCExporterSetting setting) {
blockingStub = MetricExportServiceGrpc.newBlockingStub(channel);
exportBuffer = new
DataCarrier<ExportData>(setting.getBufferChannelNum(),
setting.getBufferChannelSize());
exportBuffer.consume(this, 1, 200);
- subscriptionSet = new HashSet<>();
+ subscriptionList = new ArrayList<>();
+ fetchListLock = new ReentrantLock();
}
@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));
- }
+ Metrics metrics = event.getMetrics();
+ if (metrics instanceof WithMetadata) {
+ MetricsMetaInfo meta = ((WithMetadata) metrics).getMeta();
+ if (subscriptionList.size() == 0 &&
ExportEvent.EventType.INCREMENT.equals(event.getType())) {
Review comment:
@kezhenxu94 I fixed this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]