Adjust warn/alert tiggers

This commit is contained in:
chimp1984 2020-10-24 12:52:11 -05:00
parent 4f4f2c457b
commit 69b399780d
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
3 changed files with 13 additions and 8 deletions

View file

@ -23,6 +23,11 @@ public class DeviationByPercentage implements DeviationType {
private final double lowerWarnTrigger;
private final double upperWarnTrigger;
// In case want to see the % deviation but not trigger any warnings or alerts
public DeviationByPercentage() {
this(0, Double.MAX_VALUE, 0, Double.MAX_VALUE);
}
public DeviationByPercentage(double lowerAlertTrigger,
double upperAlertTrigger,
double lowerWarnTrigger,

View file

@ -71,10 +71,10 @@ public enum InventoryItem {
// Should be very close values
daoStateChainHeight("daoStateChainHeight",
true,
new DeviationByIntegerDiff(1, 3)),
new DeviationByIntegerDiff(2, 4)),
numBsqBlocks("numBsqBlocks",
true,
new DeviationByIntegerDiff(1, 3)),
new DeviationByIntegerDiff(2, 4)),
// Has to be same values at same block
daoStateHash("daoStateHash",
@ -93,7 +93,7 @@ public enum InventoryItem {
new DeviationByPercentage(0.33, 3, 0.4, 2.5)),
numConnections("numConnections",
true,
new DeviationByPercentage(0.33, 3, 0.4, 2.5)),
new DeviationByPercentage(0, Double.MAX_VALUE, 0.4, 2.5)),
peakNumConnections("peakNumConnections",
true,
new DeviationByPercentage(0.33, 3, 0.4, 2.5)),
@ -102,16 +102,16 @@ public enum InventoryItem {
new DeviationByIntegerDiff(1, 2)),
sentBytesPerSec("sentBytesPerSec",
true,
new DeviationByPercentage(0.33, 3, 0.4, 2.5)),
new DeviationByPercentage()),
receivedBytesPerSec("receivedBytesPerSec",
true,
new DeviationByPercentage(0.33, 3, 0.4, 2.5)),
new DeviationByPercentage()),
receivedMessagesPerSec("receivedMessagesPerSec",
true,
new DeviationByPercentage(0.33, 3, 0.4, 2.5)),
new DeviationByPercentage()),
sentMessagesPerSec("sentMessagesPerSec",
true,
new DeviationByPercentage(0.33, 3, 0.4, 2.5)),
new DeviationByPercentage()),
// No deviation check
sentBytes("sentBytes", true),

View file

@ -370,7 +370,7 @@ public class InventoryWebServer {
}
if (!warningsAtRequestNumber.isEmpty()) {
historicalWarnings = "Warnings at requests " + Joiner.on(" ").join(warningsAtRequestNumber);
historicalWarnings = "Warnings at requests " + Joiner.on(", ").join(warningsAtRequestNumber);
}
if (!alertsAtRequestNumber.isEmpty()) {
historicalAlerts = "Alerts at requests: " + Joiner.on(", ").join(alertsAtRequestNumber);