Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Enhance logs for non-standard sender factory usage #657

Merged
merged 3 commits into from
Oct 11, 2019

Conversation

vpbhargav
Copy link
Contributor

Add logs to SenderResolver to handle non-standard usages
of SenderFactory. Commit addresses #532.

Signed-off-by: Bhargava Varadharajan [email protected]

Which problem is this PR solving?

Short description of the changes

Add logs to SenderResolver to handle non-standard usages
of SenderFactory. Commit addresses jaegertracing#532.

Signed-off-by: Bhargava Varadharajan <[email protected]>
@codecov
Copy link

codecov bot commented Oct 10, 2019

Codecov Report

Merging #657 into master will decrease coverage by <.01%.
The diff coverage is 91.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #657      +/-   ##
===========================================
- Coverage      89.4%   89.4%   -0.01%     
- Complexity      563     567       +4     
===========================================
  Files            69      69              
  Lines          2076    2085       +9     
  Branches        263     266       +3     
===========================================
+ Hits           1856    1864       +8     
  Misses          138     138              
- Partials         82      83       +1
Impacted Files Coverage Δ Complexity Δ
...jaegertracing/internal/senders/SenderResolver.java 95% <91.66%> (-1.78%) 13 <0> (+4)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02150c7...11560bd. Read the comment docs.

Copy link
Collaborator

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from a test case that seems to be covered by another test, LGTM.

boolean isRequestedFactoryAvailable = false;
if (!senderFactoryIterator.hasNext()) {
log.warn("No sender factories available");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could probably short-circuit here and return NoopSender() directly. Doesn't make much difference in the runtime, especially once the VM is warmed up, but makes the code easier to read.

@@ -81,6 +81,22 @@ public void testMultipleImplementationsAmbiguous() throws Exception {
assertTrue(sender instanceof NoopSender);
}

@Test
public void testMultipleFactoriesButFactoryNotSpecified() throws Exception {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as testMultipleImplementationsAmbiguous ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. My bad. Removed redundant test.

Copy link
Collaborator

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just remove the unused import and I'll merge it.

@@ -30,6 +30,7 @@
import java.nio.file.Path;
import java.util.Scanner;
import org.junit.After;
import org.junit.Ignore;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this and one other unused import( import io.jaegertracing.spi.SenderFactory;) in the same class.

Signed-off-by: Bhargava Varadharajan <[email protected]>
@jpkrohling jpkrohling merged commit 23a8223 into jaegertracing:master Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use clear messages about non-standard usage of the sender factory
2 participants