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

Improved handling unavailable metrics #1028

Merged
merged 3 commits into from
May 28, 2019

Conversation

piotrrzysko
Copy link
Member

@piotrrzysko piotrrzysko commented May 28, 2019

Resolves #989

return UNAVAILABLE;
}

public static MetricLongValue of(long lag) {
Copy link
Contributor

Choose a reason for hiding this comment

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

lag -> value ? :)

this.value = value;
}

public static MetricDecimalValue unavailable() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we cannot make UNAVAILABLE as a public field and just use it?

Copy link
Member Author

Choose a reason for hiding this comment

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

In my opinion unavailable() is better in this case because it is consistent with other factory method - of(...).

private static final String UNAVAILABLE_STRING = "unavailable";
private static final MetricDecimalValue UNAVAILABLE = new MetricDecimalValue(true, "-1.0");

private final boolean unavailable;
Copy link
Contributor

Choose a reason for hiding this comment

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

Storing non-negated field might be more readable, wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

or not

@piotrrzysko piotrrzysko merged commit cb64c21 into master May 28, 2019
@piotrrzysko piotrrzysko deleted the fix-to-subscription-metrics-error branch May 28, 2019 14:27
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.

Endpoint to query subscription metrics returns error
4 participants