-
Notifications
You must be signed in to change notification settings - Fork 210
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
Conversation
return UNAVAILABLE; | ||
} | ||
|
||
public static MetricLongValue of(long lag) { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or not
Resolves #989