Skip to content

Conversation

@dhaval24
Copy link
Contributor

This PR Enables the cold start of the SDK by removing most of the logAlways() calls. Only throttling statements now have logAlways() calls in the SDK. Every other place this call has been removed to reduce tracing.

Fix #590

@dhaval24 dhaval24 requested review from grlima and littleaj March 10, 2018 04:24
@dhaval24 dhaval24 self-assigned this Mar 10, 2018
@dhaval24 dhaval24 added this to the 2.0.2 milestone Mar 10, 2018
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.

Some minor nitpicks. Overall, it looks good. Thanks, @dhaval24 !

boolean debugMode = Boolean.valueOf(debugModeAsString);
agentConfiguration.setDebugMode(debugMode);
InternalAgentLogger.INSTANCE.logAlways(InternalAgentLogger.LoggingLevel.ERROR, "Instrumentation debug mode set to '%s'", debugMode);
InternalAgentLogger.INSTANCE.warn("Instrumentation debug mode set to '%s'", debugMode);
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, this is an info message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure should be info. I dropped one level down (it was ERROR before). I will drop it down to INFO. Thanks for pointing out.

} catch (FileNotFoundException e) {
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.WARN, "Configuration file '%s' could not be opened for reading", configurationFile);
InternalLogger.INSTANCE.trace("stack trace is %s", ExceptionUtils.getStackTrace(e));
InternalLogger.INSTANCE.warn("Configuration file '%s' could not be opened for reading %s", configurationFile,
Copy link
Contributor

Choose a reason for hiding this comment

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

generally, i think it's a good idea to have a colon (:) before the stack trace printout.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure will add a colon before stacktrace statements.

}
} else {
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.WARN, "Configuration file '%s' could not be found", configurationFileName);
InternalLogger.INSTANCE.error("Configuration file '%s' could not be found", configurationFileName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why error instead of warn?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought that AI configuration file is required. I am aware that there is certain sort of default configuration but still I thought that config file has iKey. unless user passes it as an environment variable it needs to be present here.

@dhaval24
Copy link
Contributor Author

@littleaj just added a commit to better decorate the log messages.

@dhaval24
Copy link
Contributor Author

@littleaj I have merged the latest master and have resolved all the merge conflicts. Please take a look once and then I would merge this.

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.

@dhaval24 Looks good; with one comment:
Run the gradle prepare task and make sure the <p> tags with no closing tag in the javadoc don't cause the javadoc task to fail. I'd rather catch that now than when we are trying to release.

@dhaval24
Copy link
Contributor Author

@littleaj thanks I ran gradle prepare and it succeeded without issues.

@dhaval24 dhaval24 merged commit eedfe2d into master Mar 14, 2018
@grlima grlima deleted the revisitLogAlwaysCalls branch March 15, 2018 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants