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

Remove negative value from server idle #5061

Open
wants to merge 1 commit into
base: 2.1
Choose a base branch
from

Conversation

ddanielr
Copy link
Contributor

When using a sum aggregator for metric queries, the possible negative value removes values causing graphing issues.

Removes the startup value of the service (-1) in favor of reporting an initial error state.

When using a sum aggregator for metric queries, the possible negative
value removes values causing graphing issues.

Removes the startup value of the service (-1) in favor of reporting an
initial error state.
@ddanielr ddanielr added this to the 2.1.4 milestone Nov 14, 2024
}

public double getIdleAsDouble(ProcessMetrics processMetrics) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we just make this an int? There are two possible values and both are whole numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could. The Gauge.builder is going to convert it to a double but we could use an int beforehand and let the builder deal with the conversion.

Copy link
Contributor

Choose a reason for hiding this comment

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

The previous code returned an int, which is why I asked. If Micrometer is just turning that into a double, then what you have is fine. Thanks!

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.

3 participants