Upload folder via GUI - src
This commit is contained in:
@@ -25,6 +25,10 @@ public class AlertManager {
|
|||||||
// Standard-Cooldown: 5 Minuten
|
// Standard-Cooldown: 5 Minuten
|
||||||
private static final long DEFAULT_COOLDOWN_MS = 5 * 60 * 1000;
|
private static final long DEFAULT_COOLDOWN_MS = 5 * 60 * 1000;
|
||||||
|
|
||||||
|
// Startup-Grace-Period
|
||||||
|
private final long pluginStartTimeMs = System.currentTimeMillis();
|
||||||
|
private final long startupGracePeriodMs;
|
||||||
|
|
||||||
// Zähler für kritische Ereignisse (für Auto-Diagnose)
|
// Zähler für kritische Ereignisse (für Auto-Diagnose)
|
||||||
private int criticalEventCount = 0;
|
private int criticalEventCount = 0;
|
||||||
|
|
||||||
@@ -33,6 +37,7 @@ public class AlertManager {
|
|||||||
|
|
||||||
public AlertManager(ServerPulse plugin) {
|
public AlertManager(ServerPulse plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
this.startupGracePeriodMs = plugin.getConfigManager().getStartupCheckDelayMinutes() * 60_000L;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ──────────────────────────────────────────
|
// ──────────────────────────────────────────
|
||||||
@@ -44,6 +49,12 @@ public class AlertManager {
|
|||||||
*/
|
*/
|
||||||
public void triggerAlert(String alertType, AlertSeverity severity, String worldName,
|
public void triggerAlert(String alertType, AlertSeverity severity, String worldName,
|
||||||
String message, Double currentValue, Double threshold) {
|
String message, Double currentValue, Double threshold) {
|
||||||
|
// Startup-Grace-Period prüfen
|
||||||
|
if (isStartupGracePeriodActive()) {
|
||||||
|
plugin.debug("Startup-Delay aktiv: Alert unterdrückt (" + alertType + ")");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Cooldown prüfen
|
// Cooldown prüfen
|
||||||
String cooldownKey = alertType + (worldName != null ? "_" + worldName : "");
|
String cooldownKey = alertType + (worldName != null ? "_" + worldName : "");
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
@@ -211,4 +222,8 @@ public class AlertManager {
|
|||||||
public int getCriticalEventCount() {
|
public int getCriticalEventCount() {
|
||||||
return criticalEventCount;
|
return criticalEventCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isStartupGracePeriodActive() {
|
||||||
|
return System.currentTimeMillis() - pluginStartTimeMs < startupGracePeriodMs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ public class ConfigManager {
|
|||||||
return config.getInt("general.data-retention-days", 90);
|
return config.getInt("general.data-retention-days", 90);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getStartupCheckDelayMinutes() {
|
||||||
|
return Math.max(0, config.getInt("general.startup-check-delay-minutes", 5));
|
||||||
|
}
|
||||||
|
|
||||||
// ──────────────────────────────────────────
|
// ──────────────────────────────────────────
|
||||||
// DATENBANK
|
// DATENBANK
|
||||||
// ──────────────────────────────────────────
|
// ──────────────────────────────────────────
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: ServerPulse
|
name: ServerPulse
|
||||||
version: '1.0.0'
|
version: '1.0.1'
|
||||||
main: de.serverpulse.bungee.BungeePlugin
|
main: de.serverpulse.bungee.BungeePlugin
|
||||||
author: ServerPulse-Team
|
author: ServerPulse-Team
|
||||||
description: ServerPulse BungeeCord Module (unified JAR)
|
description: ServerPulse BungeeCord Module (unified JAR)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# ╔══════════════════════════════════════════╗
|
# ╔══════════════════════════════════════════╗
|
||||||
# ║ ServerPulse v1.0.0 Configuration ║
|
# ║ ServerPulse v1.0.1 Configuration ║
|
||||||
# ║ Unified JAR – Spigot / Paper / Bungee ║
|
# ║ Unified JAR – Spigot / Paper / Bungee ║
|
||||||
# ╚══════════════════════════════════════════╝
|
# ╚══════════════════════════════════════════╝
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: ServerPulse
|
name: ServerPulse
|
||||||
version: '1.0.0'
|
version: '1.0.1'
|
||||||
main: de.serverpulse.spigot.SpigotPlugin
|
main: de.serverpulse.spigot.SpigotPlugin
|
||||||
api-version: '1.21'
|
api-version: '1.21'
|
||||||
description: Monitoring & Analytics Suite (Spigot/Paper/BungeeCord unified)
|
description: Monitoring & Analytics Suite (Spigot/Paper/BungeeCord unified)
|
||||||
|
|||||||
Reference in New Issue
Block a user