Skip to content

Conversation

@anandsugumaran
Copy link
Contributor

Fix #535

Fixed both the below issues in this commit.

  1. New version of FixedRate Sampling worked only with global sampling percentage and not with user set sampling percentage.

  2. Old version of FixedRate Sampling sets sampling score as SamplingPercentage once sampled in. It has to be sampling percentage.

@msftclas
Copy link

msftclas commented Jan 29, 2018

CLA assistant check
All CLA requirements met.


return false;
}
samplingSupportingTelemetry.setSamplingPercentage(telemetrySamplingScore);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

telemetrySamplingScore is a dynamically generated value based on operation id. This cannot be set as Sampling percentage after sampled in since this will affect the item count value in the analytics portal. So replaced this with testedPercentage which will have the correct sampling percentage.


samplingSupportingTelemetry.setSamplingPercentage(samplingPercentage);

if (SamplingScoreGeneratorV2.getSamplingScore(telemetry) >= samplingPercentage) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per existing code , sampling will work only when the user didn't set the sampling percentage. To fix this moved the code which samples the telemetry out of the if condition.

InternalLogger.INSTANCE.info("Item has sampling percentage already set to :"
+ samplingSupportingTelemetry.getSamplingPercentage());

samplingPercentage = samplingSupportingTelemetry.getSamplingPercentage();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Override the local sampling percentage with the user set sampling percentage. Else global sampling percentage will be applied even if the user has set the sampling percentage.

Copy link
Contributor Author

@anandsugumaran anandsugumaran left a comment

Choose a reason for hiding this comment

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

Please review the changes done to fix the issues in FixedRateSampling

@dhaval24 dhaval24 added this to the 2.0.1 milestone Jan 29, 2018
@dhaval24 dhaval24 added the Bug label Jan 29, 2018
@dhaval24
Copy link
Contributor

@anandsugumaran thank you very much for your valuable contribution. We would review it and let you know if there needs to be any changes.

Copy link
Contributor

@dhaval24 dhaval24 left a comment

Choose a reason for hiding this comment

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

Changes look fine to me. I agree that when user programatically sets the sampling percentage it should be honored to the highest priority. I will let others also review this before we merge into.

@anandsugumaran
Copy link
Contributor Author

@littleaj @grlima Can you please review this PR ?

Copy link
Contributor

@littleaj littleaj left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for your contribution!

@dhaval24
Copy link
Contributor

dhaval24 commented Feb 2, 2018

@anandsugumaran by the way just was curious, were you able to do an E2E testing with your change and able to see the right item counts on the Analytics Portal? We would like to analyze that before merging this, and ofcourse as @littleaj said thank you very much for your valuable contribution.

@anandsugumaran
Copy link
Contributor Author

@dhaval24 yeah I did and it looked good in the portal as well.

@anandsugumaran
Copy link
Contributor Author

@dhaval24 can you merge the changes if it's looking good

@dhaval24
Copy link
Contributor

dhaval24 commented Feb 8, 2018

@anandsugumaran sure, we will do that by the end of the day.

@dhaval24 dhaval24 merged commit ff79610 into microsoft:master Feb 9, 2018
@dhaval24
Copy link
Contributor

dhaval24 commented Feb 9, 2018

@anandsugumaran thank you very much for your contribution. We have merged your changes and it would likely be the part of 2.1.0 version of our SDK (Which is one release after the stable 2.0.0 version)

dhaval24 pushed a commit that referenced this pull request Feb 16, 2018
…540)

Overriding default sampling percentage when programatically specified sampling percentage by user.
@dhaval24
Copy link
Contributor

@anandsugumaran your changes are being taken to stable release of our SDK which would happen soon. Hopefully this would unblock your team.

@anandsugumaran
Copy link
Contributor Author

@dhaval24 Thanks Dhaval.

littleaj added a commit that referenced this pull request Mar 8, 2018
* Fix null ref check in telemetry correlation Utils (#541)

* Fix null ref check in TelemetryCorrelationUtils

* Modifying log level to warning

* Updating Changelog

* Fix handling of NaN and +/-Infinity in JSON serializer (#499)

* Handle NaN and +/-Infinity in metrics

* Default NaN/Infinity serialization to 0 to be consistent with other AI SDKs and make the code compatible with Java 6

* fixed javadoc errors and added section to generate pom.xml with all builds (#551)

* Updating version number to 2.0.0

* Implementing Retry logic [Reliable Channel] [STABLE Branch] (#561)

* Initial commit of retry and backoff logic fixes

* Fixing warnings on files I touched this round

* Fix the eclipse UI from screaming about the docker Contstants

* Fixed backoff logic to use existing method. Added more logging to the sender channel.

* Added the partial response handler, more logging

* Added gson to core. Fixed backoff manager to keep original functionality. Added extension to return the timeout values as expected before.

* Added unit tests.

* Fixing string typed ArrayList<> to List<> per Dhaval

* Missed one

* Making tests consistent.

* Added javadoc comments, simplified logic for a few methods

* Added exception logging per @dhaval24. Fixed formatting on touched files

* Updates per last round of commits

Moved the Handlers out of the concrete package to the common package to keep the same consistency.  Removed a couple of unessecary methods. Added docs.

* Latest fixes

* Add MaxInstantRetry

Added MaxInstantRetry configuration to allow for instantaneous retry on a failed transmission.

* Javadoc Updates

Javadoc and formatting updates

* NumberFormatException fix

Added null check

* JavaDocs for TPM

* Fixing FixedRateSampling to work in old and new version of sampling (#540)

Overriding default sampling percentage when programatically specified sampling percentage by user.

* upgrade to logback v1.2.3 (#565)

* Reliable channel: replacing logAlways "TRACE" statements with "info" (#571)

* Reliable channel: close resources in finally block. (#572)

* Reliable channel: close resources in finally block.

* change logging to warning when closing resources

* Bugfix against retry logic (#576)

* Refactor

* BUGFIX Logic would never backoff

After adding the instant retry amount logic to the code this line of code could cause the transmissions to not back off.

* Changes requested

* Fixed javadocs tags, that caused build errors while executing `javadoc` gradle task (#578)

* Update Changelog

* Fix link in changelog

* Fix another link in changelog

* Update gradle.properties

* Fix customizing pom.xml in Gradle build (#582)

* Fix customizing pom.xml in Gradle build

* Insert license after 1. row in pom.xml

* Filter artifacts relocated by shadow task from pom dependencies

- match artifacts by groupId
- fixes #583 

* Generate a pom file "beside" the artifact jar file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants