Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLCORE-1149 Trace execution of analysis requests and sensors #1232

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

jblievremont
Copy link
Member

@jblievremont jblievremont commented Jan 28, 2025

@jblievremont jblievremont force-pushed the SLCORE-1149-analysis-tracing branch 3 times, most recently from aab7fe4 to 58ef518 Compare February 3, 2025 09:34
@jblievremont jblievremont marked this pull request as ready for review February 3, 2025 09:50
Copy link
Contributor

@damien-urruty-sonarsource damien-urruty-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM. My only remark is that the tests are mostly there for coverage but do not really assert anything related to the trace and how it's reported. But it's probably fine

var sampleRateFromSystemProperty = System.getProperty(TRACES_SAMPLE_RATE_PROPERTY);
return Double.parseDouble(sampleRateFromSystemProperty);
} catch (RuntimeException e) {
return TRACES_SAMPLE_RATE_DEFAULT;
Copy link
Contributor

Choose a reason for hiding this comment

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

A small log here could help. Just in case...


public SensorsExecutor(DefaultSensorContext context, SensorOptimizer sensorOptimizer, ProgressMonitor progress, Optional<List<ProjectSensor>> sensors) {
public SensorsExecutor(DefaultSensorContext context, SensorOptimizer sensorOptimizer, ProgressMonitor progress, @Nullable Trace trace, Optional<List<ProjectSensor>> sensors) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought Nullable parameter injection was not working since the investigation I made recently around DBD and Java SE. But maybe in some specific contexts it does work 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a bit weird yes. For the sake of consistency, we could go with Optional (like for the list of sensors), it does not make a huge difference.

@jblievremont jblievremont force-pushed the SLCORE-1149-analysis-tracing branch from c318d46 to 9b4c482 Compare February 3, 2025 14:57
@jblievremont jblievremont merged commit 7680924 into master Feb 3, 2025
11 checks passed
@jblievremont jblievremont deleted the SLCORE-1149-analysis-tracing branch February 3, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants