All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scouter.server.plugin.alert.AlertUtil Maven / Gradle / Ivy

There is a newer version: 2.20.0
Show newest version
package scouter.server.plugin.alert;

import scouter.lang.pack.AlertPack;
import scouter.server.core.AlertCore;

public class AlertUtil {

	public static void alert(byte level, RealCounter c, String title, String message) {
		long now = System.currentTimeMillis();
		if (c.silentTime() > 0) {
			if (now < c.lastAlertTime(level) + c.silentTime() * 1000)
				return;
		}
		AlertPack p = new AlertPack();
		p.time = now;
		p.level = level;
		p.objHash = c.objHash();
		p.objType = c.objType();
		p.title = title;
		p.message = message;
		c.setAlertTime(level, now);
		AlertCore.add(p);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy