/** * Tells whether this instance should be instrumented */ default boolean isMarkedForInstrumentation() { return this.getChannel().isMarkedForInstrumentation(); }
/** * If the given {@link ChannelInstance} has a measured cardinality, then register this cardinality in the * {@link #crossPlatformExecutor} with the corresponding {@link Channel} and all its siblings. * * @param channelInstance the said {@link ChannelInstance} */ protected void registerMeasuredCardinality(ChannelInstance channelInstance) { // Check if a cardinality was measured in the first place. final OptionalLong optionalCardinality = channelInstance.getMeasuredCardinality(); if (!optionalCardinality.isPresent()) { if (channelInstance.getChannel().isMarkedForInstrumentation()) { this.logger.warn( "No cardinality available for {}, although it was requested.", channelInstance.getChannel() ); } return; } this.crossPlatformExecutor.addCardinalityMeasurement(channelInstance); }