-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-3649 Change ping bars to consistent scale + now 3 colours
- Loading branch information
Showing
7 changed files
with
262 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
stroom-core-shared/src/main/java/stroom/ui/config/shared/NodeMonitoringConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package stroom.ui.config.shared; | ||
|
||
import stroom.util.shared.AbstractConfig; | ||
import stroom.util.shared.IsStroomConfig; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
|
||
import java.util.Objects; | ||
import javax.validation.constraints.Min; | ||
|
||
@JsonPropertyOrder(alphabetic = true) | ||
@JsonInclude(Include.NON_NULL) | ||
public class NodeMonitoringConfig extends AbstractConfig implements IsStroomConfig { | ||
|
||
@Min(1) | ||
@JsonProperty | ||
@JsonPropertyDescription("The threshold in milliseconds, above which a node ping response time is " + | ||
"considered to have a severity of warning and the ping bar will be coloured accordingly. " + | ||
"Must be lest then or equal to pingMaxThreshold.") | ||
private final int pingWarnThreshold; | ||
|
||
@Min(1) | ||
@JsonProperty | ||
@JsonPropertyDescription("The maximum number of milliseconds that the node monitoring ping bar " + | ||
"can display. Above this value the ping bar will be displayed in a different colour to " + | ||
"indicate it has exceeded the maximum threshold. This value should be greater than or equal " + | ||
"to pingWarnThreshold") | ||
private final int pingMaxThreshold; | ||
|
||
public NodeMonitoringConfig() { | ||
pingWarnThreshold = 100; | ||
pingMaxThreshold = 500; | ||
} | ||
|
||
@JsonCreator | ||
public NodeMonitoringConfig(@JsonProperty("pingWarnThreshold") final int pingWarnThreshold, | ||
@JsonProperty("pingMaxThreshold") final int pingMaxThreshold) { | ||
this.pingWarnThreshold = pingWarnThreshold; | ||
this.pingMaxThreshold = pingMaxThreshold; | ||
} | ||
|
||
public int getPingWarnThreshold() { | ||
return pingWarnThreshold; | ||
} | ||
|
||
public int getPingMaxThreshold() { | ||
return pingMaxThreshold; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
final NodeMonitoringConfig that = (NodeMonitoringConfig) o; | ||
return pingWarnThreshold == that.pingWarnThreshold && pingMaxThreshold == that.pingMaxThreshold; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(pingWarnThreshold, pingMaxThreshold); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "NodeMonitoringConfig{" + | ||
"pingWarnThreshold=" + pingWarnThreshold + | ||
", pingMaxThreshold=" + pingMaxThreshold + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.