本文整理汇总了Java中scouter.lang.counters.CounterConstants类的典型用法代码示例。如果您正苦于以下问题:Java CounterConstants类的具体用法?Java CounterConstants怎么用?Java CounterConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CounterConstants类属于scouter.lang.counters包,在下文中一共展示了CounterConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: PManager
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
private PManager() {
store.setDefault(PreferenceConstants.P_CHART_LINE_WIDTH, 1);
store.setDefault(PreferenceConstants.P_XLOG_IGNORE_TIME, 0);
store.setDefault(PreferenceConstants.P_XLOG_MAX_COUNT, 1000000);
store.setDefault(PreferenceConstants.P_XLOG_DRAG_MAX_COUNT, 200);
store.setDefault(PreferenceConstants.P_PERS_WAS_SERV_DEFAULT_HOST, CounterConstants.LINUX);
store.setDefault(PreferenceConstants.P_PERS_WAS_SERV_DEFAULT_WAS, CounterConstants.TOMCAT);
store.setDefault(PreferenceConstants.P_PERS_WAS_SERV_DEFAULT_DB, CounterConstants.MARIA_DB);
store.setDefault(PreferenceConstants.P_MASS_PROFILE_BLOCK, 10);
for (XLogColumnEnum xLogColumnEnum : XLogColumnEnum.values()) {
store.setDefault(xLogColumnEnum.getInternalID(), xLogColumnEnum.isDefaultVisible());
}
// store.setDefault(PreferenceConstants.P_UPDATE_SERVER_ADDR, PORT_AND_REPOSITORY_FOLDER);
// store.setDefault(PreferenceConstants.P_ALERT_DIALOG_TIMEOUT, -1);
// store.setDefault(PreferenceConstants.NOTIFY_FATAL_ALERT, true);
// store.setDefault(PreferenceConstants.NOTIFY_WARN_ALERT, false);
// store.setDefault(PreferenceConstants.NOTIFY_ERROR_ALERT, false);
// store.setDefault(PreferenceConstants.NOTIFY_INFO_ALERT, true);
}
开发者ID:scouter-project,项目名称:scouter,代码行数:24,代码来源:PManager.java
示例2: addObjTypeSpecialMenu
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public static void addObjTypeSpecialMenu(IWorkbenchWindow win, IMenuManager mgr, int serverId, String objType, CounterEngine counterEngine) {
if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_JAVAEE)) {
mgr.add(new Separator());
mgr.add(new OpenRTPairAllAction(win, "Heap Memory", serverId, objType, CounterConstants.JAVA_HEAP_TOT_USAGE));
mgr.add(new OpenEQViewAction(win, serverId, objType));
mgr.add(new OpenVerticalEQViewAction(win, serverId, objType));
mgr.add(new OpenActiveServiceListAction(win, objType, Images.thread, serverId));
mgr.add(new OpenActiveSpeedAction(win,objType, Images.TYPE_ACTSPEED, serverId));
mgr.add(new OpenXLogRealTimeAction(win, MenuStr.XLOG, objType, Images.star, serverId));
mgr.add(new OpenTodayServiceCountAction(win, MenuStr.SERVICE_COUNT, objType, CounterConstants.WAS_SERVICE_COUNT, Images.bar, serverId));
MenuManager serviceGroupMgr = new MenuManager("Serivce Group", ImageUtil.getImageDescriptor(Images.sum), "scouter.menu.id.javee.servicegroup");
mgr.add(serviceGroupMgr);
serviceGroupMgr.add(new OpenServiceGroupTPSAction(win, serverId, objType));
serviceGroupMgr.add(new OpenServiceGroupElapsedAction(win, serverId, objType));
mgr.add(new OpenUniqueTotalVisitorAction(win, serverId, objType));
mgr.add(new OpenTypeSummaryAction(win, serverId, objType));
mgr.add(new OpenRTPairAllAction(win, "File Descriptor", serverId, objType, CounterConstants.JAVA_FD_USAGE));
} else if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_DATASOURCE)) {
mgr.add(new Separator());
mgr.add(new OpenRTPairAllAction2(win, "Pool Chart", serverId, objType, CounterConstants.DATASOURCE_CONN_MAX, CounterConstants.DATASOURCE_CONN_ACTIVE));
}
}
开发者ID:scouter-project,项目名称:scouter,代码行数:23,代码来源:MenuUtil.java
示例3: getGCInfo
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
@Counter
public void getGCInfo(CounterBasket pw) {
long[] gcInfo = SysJMX.getCurrentProcGcInfo();
if (oldGc == null) {
oldGc = gcInfo;
return;
}
long dCount = gcInfo[0] - oldGc[0];
long dTime = gcInfo[1] - oldGc[1];
oldGc = gcInfo;
gcCountInfo.add(dCount);
gcTimeInfo.add(dTime);
PerfCounterPack p = pw.getPack(TimeTypeEnum.REALTIME);
p.put(CounterConstants.JAVA_GC_COUNT, new DecimalValue(dCount));
p.put(CounterConstants.JAVA_GC_TIME, new DecimalValue(dTime));
p = pw.getPack(TimeTypeEnum.FIVE_MIN);
p.put(CounterConstants.JAVA_GC_COUNT, new DecimalValue((long) gcCountInfo.getSum(300)));
p.put(CounterConstants.JAVA_GC_TIME, new DecimalValue((long) gcTimeInfo.getSum(300)));
}
开发者ID:scouter-project,项目名称:scouter,代码行数:27,代码来源:GCInfo.java
示例4: getHeapUsage
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
@Counter
public void getHeapUsage(CounterBasket pw) {
long total = Runtime.getRuntime().totalMemory();
long free = Runtime.getRuntime().freeMemory();
float used = (float) ((total - free) / 1024. / 1024.);
heapmin.add(total - free);
float usedmin = (float) (heapmin.getAvg(300) / 1024. / 1024.);
ListValue heapValues = new ListValue();
heapValues.add((float) (total / 1024. / 1024.));
heapValues.add(used);
PerfCounterPack p = pw.getPack(TimeTypeEnum.REALTIME);
p.put(CounterConstants.JAVA_HEAP_TOT_USAGE, heapValues);
p.put(CounterConstants.JAVA_HEAP_USED, new FloatValue(used));
p = pw.getPack(TimeTypeEnum.FIVE_MIN);
p.put(CounterConstants.JAVA_HEAP_USED, new FloatValue(usedmin));
}
开发者ID:scouter-project,项目名称:scouter,代码行数:22,代码来源:HeapUsage.java
示例5: resetObjInfo
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public synchronized void resetObjInfo() {
String detected = CounterConstants.HOST;
if (SystemUtil.IS_LINUX) {
detected = CounterConstants.LINUX;
} else if (SystemUtil.IS_WINDOWS) {
detected = CounterConstants.WINDOWS;
} else if (SystemUtil.IS_MAC_OSX) {
detected = CounterConstants.OSX;
} else if (SystemUtil.IS_AIX) {
detected = CounterConstants.AIX;
} else if (SystemUtil.IS_HP_UX) {
detected = CounterConstants.HPUX;
}
this.objDetectedType = detected;
this.monitoring_group_type = getValue("monitoring_group_type");
this.obj_type = StringUtil.isEmpty(this.monitoring_group_type) ? getValue("obj_type", detected) : this.monitoring_group_type;
this.obj_name = getValue("obj_name", SysJMX.getHostName());
this.objName = "/" + this.obj_name;
this.objHash = HashUtil.hash(objName);
}
开发者ID:scouter-project,项目名称:scouter,代码行数:25,代码来源:Configure.java
示例6: createPartControl
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public void createPartControl(Composite parent) {
AgentObject agent = AgentModelThread.getInstance().getAgentObject(objHash);
if (agent == null) {
this.objType = CounterConstants.TOMCAT;
this.setPartName(title + "[" + objHash + "]");
} else {
this.objType = agent.getObjType();
this.setPartName(title + "[" + agent.getObjName() + "]");
}
super.createPartControl(parent);
}
开发者ID:scouter-project,项目名称:scouter,代码行数:12,代码来源:CounterMapStackView.java
示例7: OpenServiceGroupElapsedAction
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public OpenServiceGroupElapsedAction(IWorkbenchWindow window, int serverId, String objType) {
this.window = window;
this.serverId = serverId;
this.objType = objType;
setText("Elapsed");
setId(ID);
setImageDescriptor(Images.getCounterImageDescriptor(objType, CounterConstants.WAS_ELAPSED_TIME, serverId));
}
开发者ID:scouter-project,项目名称:scouter,代码行数:9,代码来源:OpenServiceGroupElapsedAction.java
示例8: OpenServiceGroupTPSAction
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public OpenServiceGroupTPSAction(IWorkbenchWindow window, int serverId, String objType) {
this.window = window;
this.serverId = serverId;
this.objType = objType;
setText("Throughput");
setId(ID);
setImageDescriptor(Images.getCounterImageDescriptor(objType, CounterConstants.WAS_TPS, serverId));
}
开发者ID:scouter-project,项目名称:scouter,代码行数:9,代码来源:OpenServiceGroupTPSAction.java
示例9: goLoadCounteView
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
private void goLoadCounteView(){
try {
CounterLoadCountView view = (CounterLoadCountView) win.getActivePage().showView(
CounterLoadCountView.ID, Hexa32.toString32(objHash) + "-" + objType + CounterConstants.WAS_SERVICE_COUNT + "-" + date,
IWorkbenchPage.VIEW_ACTIVATE);
if (view != null) {
view.setInput(date, objType, CounterConstants.WAS_SERVICE_COUNT, objHash, serverId);
}
} catch (Exception e) {
MessageDialog.openError(win.getShell(), "Error", "Error opening view:" + e.getMessage());
}
}
开发者ID:scouter-project,项目名称:scouter,代码行数:13,代码来源:OpenPastCountViewAction.java
示例10: getActionName
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public static String getActionName(String key) {
if (CounterConstants.REAL_TIME_ALL.equals(key) || CounterConstants.PAST_TIME_ALL.equals(key)) {
return MenuStr.TIME_ALL;
} else if (CounterConstants.REAL_TIME_TOTAL.equals(key) || CounterConstants.PAST_TIME_TOTAL.equals(key)) {
return MenuStr.TIME_TOTAL;
} else if (CounterConstants.TODAY_ALL.equals(key) || CounterConstants.PAST_DATE_ALL.equals(key)) {
return MenuStr.DAILY_ALL;
} else if (CounterConstants.TODAY_TOTAL.equals(key) || CounterConstants.PAST_DATE_TOTAL.equals(key)) {
return MenuStr.DAILY_TOTAL;
} else {
return "";
}
}
开发者ID:scouter-project,项目名称:scouter,代码行数:14,代码来源:ScouterUtil.java
示例11: getActionIconName
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public static ImageDescriptor getActionIconName(String key) {
if (CounterConstants.REAL_TIME_ALL.equals(key) || CounterConstants.TODAY_ALL.equals(key)) {
return ImageUtil.getImageDescriptor(Images.all);
} else if (CounterConstants.REAL_TIME_TOTAL.equals(key) || CounterConstants.TODAY_TOTAL.equals(key)) {
return ImageUtil.getImageDescriptor(Images.sum);
} else if (CounterConstants.PAST_TIME_ALL.equals(key) || CounterConstants.PAST_DATE_ALL.equals(key)) {
return ImageUtil.getImageDescriptor(Images.all);
} else if (CounterConstants.PAST_TIME_TOTAL.equals(key) || CounterConstants.PAST_DATE_TOTAL.equals(key)) {
return ImageUtil.getImageDescriptor(Images.sum);
} else {
return null;
}
}
开发者ID:scouter-project,项目名称:scouter,代码行数:14,代码来源:ScouterUtil.java
示例12: addPastObjTypeSpecialMenu
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public static void addPastObjTypeSpecialMenu(IWorkbenchWindow win, IMenuManager mgr, int serverId, String objType, CounterEngine counterEngine, String date) {
long st = DateUtil.yyyymmdd(date);
long et = st + DateUtil.MILLIS_PER_FIVE_MINUTE;
if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_JAVAEE)) {
mgr.add(new Separator());
mgr.add(new OpenXLogLoadTimeAction(win, objType, Images.transrealtime, serverId, st, et));
mgr.add(new OpenDailyServiceCountAction(win, objType, CounterConstants.WAS_SERVICE_COUNT, Images.TYPE_SERVICE_COUNT, serverId, date));
}
}
开发者ID:scouter-project,项目名称:scouter,代码行数:10,代码来源:MenuUtil.java
示例13: resetObjInfo
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public synchronized void resetObjInfo() {
this.obj_type = getValue("obj_type", CounterConstants.BATCH);
String detected = CounterConstants.HOST;
if (SystemUtil.IS_LINUX) {
detected = CounterConstants.LINUX;
} else if (SystemUtil.IS_WINDOWS) {
detected = CounterConstants.WINDOWS;
} else if (SystemUtil.IS_MAC_OSX) {
detected = CounterConstants.OSX;
} else if (SystemUtil.IS_AIX) {
detected = CounterConstants.AIX;
} else if (SystemUtil.IS_HP_UX) {
detected = CounterConstants.HPUX;
}
this.obj_host_type = getValue("obj_host_type", detected);
this.obj_host_name = getValue("obj_host_name", SysJMX.getHostName());
this.objHostName = "/" + this.obj_host_name;
this.objHostHash = HashUtil.hash(this.objHostName);
this.obj_name_auto_pid_enabled = getBoolean("obj_name_auto_pid_enabled", false);
this.obj_name = getValue("obj_name", "batch");
this.objName = this.objHostName + "/" + this.obj_name;
// make hash value
try { this.objHash = HashUtil.hash( objName.getBytes("UTF-8")); }catch(Throwable ex){}
System.setProperty("scouter.objname", this.objName);
System.setProperty("scouter.objtype", this.obj_type);
System.setProperty("scouter.dir", agent_dir_path);
}
开发者ID:scouter-project,项目名称:scouter,代码行数:30,代码来源:Configure.java
示例14: updateBatchService
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
private void updateBatchService(){
PerfCounterPack pack = cb.getPack(conf.getObjName(), TimeTypeEnum.REALTIME);
UdpLocalServer localServer = UdpLocalServer.getInstance();
pack.put(CounterConstants.BATCH_SERVICE, new DecimalValue(Main.batchMap.size()));
pack.put(CounterConstants.BATCH_START, new DecimalValue(localServer.getStartBatchs()));
pack.put(CounterConstants.BATCH_END, new DecimalValue(localServer.getEndBatchs()));
pack.put(CounterConstants.BATCH_ENDNOSIGNAL, new DecimalValue(localServer.getEndNoSignalBatchs()));
}
开发者ID:scouter-project,项目名称:scouter,代码行数:9,代码来源:StatusSender.java
示例15: resetObjInfo
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
public synchronized void resetObjInfo() {
String detected = ObjTypeDetector.drivedType != null ? ObjTypeDetector.drivedType
: ObjTypeDetector.objType != null ? ObjTypeDetector.objType : CounterConstants.JAVA;
this.objDetectedType = detected;
this.monitoring_group_type = getValue("monitoring_group_type");
this.obj_type = StringUtil.isEmpty(this.monitoring_group_type) ? getValue("obj_type", detected) : this.monitoring_group_type;
this.objExtType = ObjTypeDetector.objExtType;
detected = CounterConstants.HOST;
if (SystemUtil.IS_LINUX) {
detected = CounterConstants.LINUX;
} else if (SystemUtil.IS_WINDOWS) {
detected = CounterConstants.WINDOWS;
} else if (SystemUtil.IS_MAC_OSX) {
detected = CounterConstants.OSX;
} else if (SystemUtil.IS_AIX) {
detected = CounterConstants.AIX;
} else if (SystemUtil.IS_HP_UX) {
detected = CounterConstants.HPUX;
}
this.obj_host_type = getValue("obj_host_type", detected);
this.obj_host_name = getValue("obj_host_name", SysJMX.getHostName());
this.objHostName = "/" + this.obj_host_name;
this.objHostHash = HashUtil.hash(objHostName);
this.obj_name_auto_pid_enabled = getBoolean("obj_name_auto_pid_enabled", false);
String defaultName;
if (this.obj_name_auto_pid_enabled == true) {
defaultName = "" + SysJMX.getProcessPID();
} else {
defaultName = this.obj_type + "1";
}
this.obj_name = getValue("obj_name", System.getProperty("jvmRoute", defaultName));
this.objName = objHostName + "/" + this.obj_name;
this.objHash = HashUtil.hash(objName);
System.setProperty("scouter.objname", this.objName);
System.setProperty("scouter.objtype", this.obj_type);
System.setProperty("scouter.dir", agent_dir_path);
}
开发者ID:scouter-project,项目名称:scouter,代码行数:40,代码来源:Configure.java
示例16: process
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
@Counter
public void process(CounterBasket pw) {
if (availableFdInfo == false) {
return;
}
// Currently supported only sun jvm on unix platform
try {
OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
if(os instanceof UnixOperatingSystemMXBean){
UnixOperatingSystemMXBean unixOs = (UnixOperatingSystemMXBean) os;
long max = unixOs.getMaxFileDescriptorCount();
long open = unixOs.getOpenFileDescriptorCount();
ListValue fdUsage = new ListValue();
fdUsage.add(max);
fdUsage.add(open);
PerfCounterPack p = pw.getPack(TimeTypeEnum.REALTIME);
p.put(CounterConstants.JAVA_FD_USAGE, fdUsage);
} else {
availableFdInfo = false;
}
} catch (Throwable th) {
Logger.println(th.getMessage());
availableFdInfo = false;
}
}
开发者ID:scouter-project,项目名称:scouter,代码行数:29,代码来源:FDInfo.java
示例17: recentUser
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
@Counter
public void recentUser(CounterBasket pw) {
int users =MeterUsers.getUsers();
PerfCounterPack p = pw.getPack(TimeTypeEnum.REALTIME);
p.put(CounterConstants.WAS_RECENT_USER, new DecimalValue(users));
p = pw.getPack(TimeTypeEnum.FIVE_MIN);
p.put(CounterConstants.WAS_RECENT_USER, new DecimalValue(users));
}
开发者ID:scouter-project,项目名称:scouter,代码行数:12,代码来源:ClientUser.java
示例18: counter
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
@ServerPlugin(PluginConstants.PLUGIN_SERVER_COUNTER)
public void counter(PerfCounterPack pack) {
String objName = pack.objName;
int objHash = HashUtil.hash(objName);
String objType = null;
String objFamily = null;
if (AgentManager.getAgent(objHash) != null) {
objType = AgentManager.getAgent(objHash).objType;
}
if (objType != null) {
objFamily = CounterManager.getInstance().getCounterEngine().getObjectType(objType).getFamily().getName();
}
try {
// in case of objFamily is javaee
if (CounterConstants.FAMILY_JAVAEE.equals(objFamily)) {
// save javaee type's objHash
if (!javaeeObjHashList.contains(objHash)) {
javaeeObjHashList.add(objHash);
}
if (pack.timetype == TimeTypeEnum.REALTIME) {
long gcTimeThreshold = conf.getLong("ext_plugin_gc_time_threshold", 0);
long gcTime = pack.data.getLong(CounterConstants.JAVA_GC_TIME);
if (gcTimeThreshold != 0 && gcTime > gcTimeThreshold) {
AlertPack ap = new AlertPack();
ap.level = AlertLevel.WARN;
ap.objHash = objHash;
ap.title = "GC time exceed a threshold.";
ap.message = objName + "'s GC time(" + gcTime + " ms) exceed a threshold.";
ap.time = System.currentTimeMillis();
ap.objType = objType;
alert(ap);
}
}
}
} catch (Exception e) {
Logger.printStackTrace(e);
}
}
开发者ID:scouter-project,项目名称:scouter-plugin-server-alert-line,代码行数:46,代码来源:LinePlugin.java
示例19: counter
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
/**
* PerfCounterPack 발생 시 처리
* @param pack
*/
@ServerPlugin(PluginConstants.PLUGIN_SERVER_COUNTER)
public void counter(PerfCounterPack pack) {
String objName = pack.objName;
int objHash = HashUtil.hash(objName);
String objType = null;
String objFamily = null;
if (AgentManager.getAgent(objHash) != null) {
objType = AgentManager.getAgent(objHash).objType;
}
if (objType != null) {
try {
objFamily = CounterManager.getInstance().getCounterEngine().getObjectType(objType).getFamily().getName();
} catch (Exception e) {
objFamily = objType;
}
}
// objFamily가 host인 경우
if (CounterConstants.FAMILY_HOST.equals(objFamily)) {
if (hostAgentStatMap.get(objHash) == null) {
hostAgentStatMap.put(objHash, new HostAgentStat(objHash));
}
if (pack.timetype == TimeTypeEnum.REALTIME) {
hostAgentStatMap.get(objHash).addMax(pack.data.getFloat(CounterConstants.HOST_CPU),
pack.data.getInt(CounterConstants.HOST_MEM_TOTAL),
pack.data.getFloat(CounterConstants.HOST_MEM),
pack.data.getInt(CounterConstants.HOST_MEM_USED),
pack.data.getInt(CounterConstants.HOST_NET_TX_BYTES),
pack.data.getInt(CounterConstants.HOST_NET_RX_BYTES),
pack.data.getInt(CounterConstants.HOST_DISK_READ_BYTES),
pack.data.getInt(CounterConstants.HOST_DISK_WRITE_BYTES));
} else if (pack.timetype == TimeTypeEnum.FIVE_MIN) {
// NET_TX, NET_RX, DISK_READ, DISK_WRITE 정보는 FIVE_MIN에 포함되지 않음.
hostAgentStatMap.get(objHash).addAvg(pack.data.getFloat(CounterConstants.HOST_CPU),
pack.data.getFloat(CounterConstants.HOST_MEM),
pack.data.getInt(CounterConstants.HOST_MEM_USED));
}
}
// objFamily가 javaee인 경우
if (CounterConstants.FAMILY_JAVAEE.equals(objFamily)) {
if (javaAgentStatMap.get(objHash) == null) {
javaAgentStatMap.put(objHash, new JavaAgentStat(objHash));
}
if (pack.timetype == TimeTypeEnum.REALTIME) {
// JAVA_HEAP_TOT_USAGE 정보가 없는 PerfCounterPack은 host agent가 동작중에 PROC_CPU 정보를 보내주는 경우와, FIVE_MIN 밖에 없음.
// PROC_CPU 정보는 수집 대상이 아님.
ListValue lv = pack.data.getList(CounterConstants.JAVA_HEAP_TOT_USAGE);
if (lv != null && lv.size() > 0) {
javaAgentStatMap.get(objHash).addMax(pack.data.getInt(CounterConstants.WAS_ACTIVE_SERVICE),
lv.getFloat(0),
pack.data.getFloat(CounterConstants.JAVA_HEAP_USED),
pack.data.getInt(CounterConstants.WAS_RECENT_USER),
pack.data.getInt(CounterConstants.WAS_SERVICE_COUNT),
pack.data.getFloat(CounterConstants.WAS_APICALL_TPS),
pack.data.getFloat(CounterConstants.WAS_SQL_TPS),
pack.data.getFloat(CounterConstants.WAS_TPS));
}
} else if (pack.timetype == TimeTypeEnum.FIVE_MIN) {
if (pack.data.toMap().get(CounterConstants.PROC_CPU) == null) {
javaAgentStatMap.get(objHash).addAvg(pack.data.getInt(CounterConstants.WAS_ACTIVE_SERVICE),
pack.data.getFloat(CounterConstants.JAVA_HEAP_USED),
pack.data.getInt(CounterConstants.WAS_RECENT_USER),
pack.data.getInt(CounterConstants.WAS_SERVICE_COUNT),
pack.data.getFloat(CounterConstants.WAS_APICALL_TPS),
pack.data.getFloat(CounterConstants.WAS_SQL_TPS),
pack.data.getFloat(CounterConstants.WAS_TPS));
}
}
}
}
开发者ID:OpenSourceConsulting,项目名称:scouter-plugin-server-reporting,代码行数:81,代码来源:ReportingPlugin.java
示例20: object
import scouter.lang.counters.CounterConstants; //导入依赖的package包/类
/**
* ObjectPack 발생 시 처리
* @param pack
*/
@ServerPlugin(PluginConstants.PLUGIN_SERVER_OBJECT)
public void object(ObjectPack pack) {
if (!pack.objType.equals(CounterConstants.REQUESTPROCESS)) {
AgentInfo agentInfo = null;
ObjectPack op = AgentManager.getAgent(pack.objHash);
boolean isExist = true;
boolean isDownState = false;
// Plugin의 loading이 채 끝나기 전에 agent로부터 heartbeat 메시지가 수신되는 경우
// 해당 Agent의 구동 정보가 누락될 수 있기 때문에 매번 agent의 상태를 조회한다.
agentInfo = selectAgentInfo(pack.objHash);
if (agentInfo == null) {
agentInfo = new AgentInfo();
isExist = false;
} else {
Date lastDownTime = agentInfo.getLast_down_time();
Date lastUpTime = agentInfo.getLast_up_time();
if (lastDownTime != null && lastUpTime != null) {
if (lastDownTime.getTime() - lastUpTime.getTime() > 0) {
isDownState = true;
}
}
}
if ((op == null && pack.wakeup == 0L) || op.alive == false || !isExist || isDownState) {
println("[AgentInfo] : " + agentInfo);
agentInfo.setObject_hash(pack.objHash);
agentInfo.setObject_name(pack.objName);
agentInfo.setObject_type(pack.objType);
if (pack.objType != null) {
String object_family;
try {
object_family = CounterManager.getInstance().getCounterEngine().getObjectType(pack.objType).getFamily().getName();
} catch (Exception e) {
object_family = pack.objType;
}
agentInfo.setObject_family(object_family);
}
agentInfo.setIp_address(pack.address);
agentInfo.setLast_up_time(new Date(System.currentTimeMillis()));
if (isExist) {
updateAgentInfo(agentInfo);
} else {
insertAgentInfo(agentInfo);
}
}
}
}
开发者ID:OpenSourceConsulting,项目名称:scouter-plugin-server-reporting,代码行数:61,代码来源:ReportingPlugin.java
注:本文中的scouter.lang.counters.CounterConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论