• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TimeTypeEnum类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中scouter.lang.TimeTypeEnum的典型用法代码示例。如果您正苦于以下问题:Java TimeTypeEnum类的具体用法?Java TimeTypeEnum怎么用?Java TimeTypeEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TimeTypeEnum类属于scouter.lang包,在下文中一共展示了TimeTypeEnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getKeepTime

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
private static long getKeepTime(byte timeType) {
	switch (timeType) {
	case TimeTypeEnum.REALTIME:
		return 10000;
	case TimeTypeEnum.ONE_MIN:
		return DateUtil.MILLIS_PER_MINUTE + 3000;
	case TimeTypeEnum.FIVE_MIN:
		return DateUtil.MILLIS_PER_MINUTE * 5 + 3000;
	case TimeTypeEnum.TEN_MIN:
		return DateUtil.MILLIS_PER_MINUTE * 10 + 3000;
	case TimeTypeEnum.HOUR:
		return DateUtil.MILLIS_PER_HOUR + 3000;
	default:
		return 30 * 10000;
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:17,代码来源:ScouterUtil.java


示例2: getGCInfo

import scouter.lang.TimeTypeEnum; //导入依赖的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


示例3: getHeapUsage

import scouter.lang.TimeTypeEnum; //导入依赖的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


示例4: counterNames

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
@Internal
public String counterNames() {
	Map m = CounterCache.getObjectCounters(_objHash, TimeTypeEnum.REALTIME);
	if (m == null)
		return "[]";
	return m.keySet().toString();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:8,代码来源:RealCounter.java


示例5: extractPerfCounterPack

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
private static PerfCounterPack extractPerfCounterPack(JSONArray perfJson, String objName) {
	PerfCounterPack perfPack = new PerfCounterPack();
	perfPack.time = System.currentTimeMillis();
	perfPack.timetype = TimeTypeEnum.REALTIME;
	perfPack.objName = objName;
	for (int i = 0; i < perfJson.size(); i++) {
		JSONObject perf = (JSONObject) perfJson.get(i);
		String name = (String) perf.get("name");
		Number value = (Number) perf.get("value");
		perfPack.data.put(name, new FloatValue(value.floatValue()));
	}
	return perfPack;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:14,代码来源:CounterHandler.java


示例6: loadPrev5min

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
private void loadPrev5min() {
	Iterator<Integer> serverIds = serverObjMap.keySet().iterator();
	final List<Pack> result = new ArrayList<Pack>();
	while (serverIds.hasNext()) {
		int serverId = serverIds.next();
		TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
		try {
			MapPack param = new MapPack();
			long etime = TimeUtil.getCurrentTime();
			long stime = etime - DateUtil.MILLIS_PER_MINUTE * 5;
			param.put("stime", stime);
			param.put("etime", etime);
			param.put("counter", counter);
			param.put("objHash", serverObjMap.get(serverId));
			
			tcp.process(RequestCmd.COUNTER_PAST_TIME_GROUP, param, new INetReader() {
				public void process(DataInputX in) throws IOException {
					Pack p = in.readPack();
					result.add(p);
				}
			});
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			TcpProxy.putTcpProxy(tcp);
		}
	}
	final Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, result, mode, TimeTypeEnum.REALTIME);
	ExUtil.exec(canvas, new Runnable() {
		public void run() {
			CircularBufferDataProvider provider = (CircularBufferDataProvider) trace.getDataProvider();
			provider.clearTrace();
			Set<Long> timeSet = valueMap.keySet();
			for (long time : timeSet) {
				provider.addSample(new Sample(CastUtil.cdouble(time), CastUtil.cdouble(valueMap.get(time))));
			}
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:40,代码来源:CounterRealTimeGroupTotalView.java


示例7: getPrevTotalPerf

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
private void getPrevTotalPerf() {
	final ArrayList<Pack> values = new ArrayList<Pack>();
	TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
	try {
		long etime = TimeUtil.getCurrentTime(serverId);
		long stime = etime - DateUtil.MILLIS_PER_MINUTE * 5;
		MapPack param = new MapPack();
		param.put("stime", stime);
		param.put("etime", etime);
		param.put("objType", objType);
		param.put("counter", counter);

		tcp.process(RequestCmd.COUNTER_PAST_TIME_ALL, param, new INetReader() {
			public void process(DataInputX in) throws IOException {
				Pack mpack =  in.readPack();
				values.add(mpack);
			};
		});
	} catch (Throwable t) {
		ConsoleProxy.errorSafe(t.toString());
	} finally {
		TcpProxy.putTcpProxy(tcp);
	}
	final Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, values, mode, TimeTypeEnum.REALTIME);
	
	ExUtil.exec(this.canvas, new Runnable() {
		public void run() {
				traceDataProvider.clearTrace();
				Set<Long> timeSet = valueMap.keySet();
				for (long time : timeSet) {
					double value = CastUtil.cdouble(valueMap.get(time));
					traceDataProvider.addSample(new Sample(time, value));
				}
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:37,代码来源:CounterRealTimeTotalView.java


示例8: setInput

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
public void setInput(long stime, long etime, String objType, String counter, int serverId) throws Exception {
	this.startTime = stime;
	this.endTime = etime;
	this.objType = objType;
	this.counter = counter;
	this.mode = CounterUtil.getTotalMode(objType, counter);
	this.serverId = serverId;
	
	setViewTab(objType, counter, serverId);
	
	this.xyGraph.primaryXAxis.setRange(stime, etime);

	Server server = ServerManager.getInstance().getServer(serverId);
	
	serverText.setText("ⓢ"+((server == null)? "?":server.getName())+" |");
	sDateText.setText(DateUtil.format(stime, "yyyy-MM-dd"));
	sTimeText.setText(DateUtil.format(stime, "hh:mm a", Locale.ENGLISH));
	eTimeText.setText(DateUtil.format(etime, "hh:mm a", Locale.ENGLISH));
	
	MenuUtil.createCounterContextMenu(ID, canvas, serverId, objType, counter);
	
	traceDataProvider.setBufferSize((int) ((etime - stime) / TimeTypeEnum.getTime(TimeTypeEnum.REALTIME) + 10));
	
	ExUtil.asyncRun(new Runnable() {
		public void run() {
			load();
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:30,代码来源:CounterPastTimeTotalView.java


示例9: getYesterdayData

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
private void getYesterdayData(String date) {
	TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
	List<Pack> out = null;
	try {
		MapPack param = new MapPack();
		param.put("counter", this.counter);
		param.put("date", date);
		param.put("objType", this.objType);
		out = tcp.process(RequestCmd.COUNTER_PAST_DATE_ALL, param);
	} catch (Throwable t) {
		ConsoleProxy.errorSafe(t.toString());
	} finally {
		TcpProxy.putTcpProxy(tcp);
	}
	final long[] values = new long[(int)(DateUtil.MILLIS_PER_DAY / DateUtil.MILLIS_PER_HOUR)];
	if (out != null) {
		Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, out, mode, TimeTypeEnum.FIVE_MIN);
		Iterator<Long> itr = valueMap.keySet().iterator();
		while (itr.hasNext()) {
			long time = itr.next();
			int index = (int) (DateUtil.getDateMillis(time) / DateUtil.MILLIS_PER_HOUR);
			values[index] += valueMap.get(time);
		}
	}
	ExUtil.exec(this.canvas, new Runnable() {
		public void run() {
			CircularBufferDataProvider yesterdayProvider = (CircularBufferDataProvider) yesterdayTrace.getDataProvider();
			yesterdayProvider.clearTrace();
			for (int i = 0; i < values.length; i++) {
				yesterdayProvider.addSample(new Sample(CastUtil.cdouble(i) + 0.5d, CastUtil.cdouble(values[i])));
			}
			yesterdayMax = ChartUtil.getMax(yesterdayProvider.iterator());
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:36,代码来源:CounterTodayCountView.java


示例10: getYesterdayData

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
private void getYesterdayData(String date) {
	final ArrayList<Pack> values = new ArrayList<Pack>();
	TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
	try {
		MapPack param = new MapPack();
		param.put("date", date);
		param.put("objType", objType);
		param.put("counter", counter);

		tcp.process(RequestCmd.COUNTER_PAST_DATE_ALL, param, new INetReader() {
			public void process(DataInputX in) throws IOException {
				Pack p = in.readPack();
				values.add(p);
			};
		});
	} catch (Throwable t) {
		t.printStackTrace();
	} finally {
		TcpProxy.putTcpProxy(tcp);
	}
	
	final Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, values, mode, TimeTypeEnum.FIVE_MIN);
	
	ExUtil.exec(this.canvas, new Runnable() {
		public void run() {
			yesterdayDataProvider.clearTrace();
			Set<Long> timeSet = valueMap.keySet();
			for (long time : timeSet) {
				yesterdayDataProvider.addSample(new Sample(CastUtil.cdouble(time + DateUtil.MILLIS_PER_DAY), CastUtil.cdouble(valueMap.get(time))));
			}
			yesterdayMax = ChartUtil.getMax(yesterdayDataProvider.iterator());
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:35,代码来源:CounterTodayTotalView.java


示例11: toString

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
public String toString() {
	StringBuffer buf = new StringBuffer();
	buf.append("PerfCounter ").append(DateUtil.timestamp(time));
	buf.append(" ").append(objName);
	buf.append(" ").append(TimeTypeEnum.getString(timetype));
	buf.append(" ").append(data);
	return buf.toString();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:9,代码来源:PerfCounterPack.java


示例12: updateBatchService

import scouter.lang.TimeTypeEnum; //导入依赖的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


示例13: counter

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
public static void counter(CounterBasket cw) {

        if (plugIn != null) {
            try {
                plugIn.counter(cw.getPack(TimeTypeEnum.REALTIME));
            } catch (Throwable th) {
            }
        }

    }
 
开发者ID:scouter-project,项目名称:scouter,代码行数:11,代码来源:PluginCounter.java


示例14: process

import scouter.lang.TimeTypeEnum; //导入依赖的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


示例15: extractJmx

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
@Counter
public void extractJmx(CounterBasket pw) {
    if (conf.counter_custom_jmx_enabled == false || mBeanServerEnable == false) {
        return;
    }
    StringSet nameSet = conf.getCustomJmxSet();
    if (nameSet.size() < 1) {
        return;
    }
    if (mBeanServer == null) {
        mBeanServer = LazyPlatformMBeanServer.create();
    }
    try {
        if (mBeanServer.checkInit()) {
            StringEnumer stringEnumer = nameSet.keys();
            PerfCounterPack pack = pw.getPack(TimeTypeEnum.REALTIME);
            while (stringEnumer.hasMoreElements()) {
                String next = stringEnumer.nextString();
                String[] mbeanAndAttribute = StringUtil.split(next, "|");
                if (mbeanAndAttribute.length != 3) continue;
                float value = mBeanServer.getValue(mbeanAndAttribute[1], mbeanAndAttribute[2]);
                if (value >= 0) {
                    pack.put(mbeanAndAttribute[0], new FloatValue(value));
                }
            }
        }
    } catch (Exception e) {
        Logger.println("SC-555", e.getMessage(), e);
        mBeanServerEnable = false;
    }

}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:33,代码来源:CustomJmx.java


示例16: recentUser

import scouter.lang.TimeTypeEnum; //导入依赖的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


示例17: process

import scouter.lang.TimeTypeEnum; //导入依赖的package包/类
public void process(CounterBasket pw) throws IOException {
	Configure conf = Configure.getInstance();

	boolean redisEnabled = conf.getBoolean("redis_enabled", false);

	if (redisEnabled) {
		String serverIp = conf.getValue("redis_server_ip", "127.0.0.1");
		int serverPort = conf.getInt("redis_server_port", 6379);

		String perfInfo = getRedisPerfInfo(serverIp, serverPort);

		String[] lines = perfInfo.split("\n");

		PerfCounterPack p = pw.getPack(conf.getObjName(), TimeTypeEnum.REALTIME);

		for (String line : lines) {
			String key = line.substring(0, line.indexOf(':'));
			String value = line.substring(line.indexOf(':') + 1);

			if (floatSet.contains(key)) {
				p.put(key, new FloatValue(Float.valueOf(value.trim())));
			}

			if (decimalSet.contains(key)) {
				p.put(key, new DecimalValue(Long.valueOf(value.trim())));
			}
		}
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:30,代码来源:RedisMonitor.java


示例18: counter

import scouter.lang.TimeTypeEnum; //导入依赖的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.TimeTypeEnum; //导入依赖的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: counter

import scouter.lang.TimeTypeEnum; //导入依赖的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-slack,代码行数:46,代码来源:SlackPlugin.java



注:本文中的scouter.lang.TimeTypeEnum类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Messages类代码示例发布时间:2022-05-22
下一篇:
Java ReceivedPacket类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap