當前位置: 首頁>>代碼示例>>Java>>正文


Java TaskStats類代碼示例

本文整理匯總了Java中backtype.storm.generated.TaskStats的典型用法代碼示例。如果您正苦於以下問題:Java TaskStats類的具體用法?Java TaskStats怎麽用?Java TaskStats使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TaskStats類屬於backtype.storm.generated包,在下文中一共展示了TaskStats類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTaskStats

import backtype.storm.generated.TaskStats; //導入依賴的package包/類
public TaskStats getTaskStats() {
	TaskStats taskStats = new TaskStats();

	taskStats.set_emitted(get_emitted());
	taskStats.set_send_tps(get_send_tps());
	taskStats.set_recv_tps(get_recv_tps());
	taskStats.set_acked(get_acked());
	taskStats.set_failed(get_failed());
	taskStats.set_process_ms_avg(get_process_latencie());

	return taskStats;
}
 
開發者ID:zhangjunfang,項目名稱:jstorm-0.9.6.3-,代碼行數:13,代碼來源:CommonStatsData.java

示例2: getComponentTasks

import backtype.storm.generated.TaskStats; //導入依賴的package包/類
private List<ComponentTask> getComponentTasks(List<TaskSummary> taskList,
		String window) {
	List<ComponentTask> ret = new ArrayList<ComponentTask>();

	for (TaskSummary task : taskList) {
		ComponentTask componentTask = UIUtils.getComponentTask(task, topologyid);
		
		if (componentTask.getStatus().equals(ConfigExtension.TASK_STATUS_ACTIVE)) {
		    TaskStats taskStats = task.get_stats();

		    Map<String, Long> emitted = UIUtils.mergeStream(
				    taskStats.get_emitted(), Long.valueOf(0));
		    Map<String, Double> sendTps = UIUtils.mergeStream(
				    taskStats.get_send_tps(), Double.valueOf(0));
		    Map<String, Double> recvTps = UIUtils.mergeStream(
				    taskStats.get_recv_tps(), Double.valueOf(0));
		    Map<String, Long> acked = UIUtils.mergeStream(
				    taskStats.get_acked(), Long.valueOf(0));
		    Map<String, Long> failed = UIUtils.mergeStream(
				    taskStats.get_failed(), Long.valueOf(0));
		    Map<String, Double> process = UIUtils.mergeStream(
				    taskStats.get_process_ms_avg(), Double.valueOf(0));
		
		    componentTask.setEmitted(JStormUtils.formatValue(emitted
				    .get(window)));
		    componentTask.setSendTps(JStormUtils.formatValue(sendTps
				    .get(window)));
		    componentTask.setRecvTps(JStormUtils.formatValue(recvTps
				    .get(window)));
		    componentTask.setAcked(JStormUtils.formatValue(acked.get(window)));
		    componentTask
				    .setFailed(JStormUtils.formatValue(failed.get(window)));
		    componentTask.setProcess(JStormUtils.formatValue(process
				    .get(window)));
		}
		ret.add(componentTask);
	}

	return ret;
}
 
開發者ID:zhangjunfang,項目名稱:jstorm-0.9.6.3-,代碼行數:41,代碼來源:SpoutPage.java

示例3: getComponentTasks

import backtype.storm.generated.TaskStats; //導入依賴的package包/類
private List<ComponentTask> getComponentTasks(List<TaskSummary> taskList,
		String window) {
	List<ComponentTask> ret = new ArrayList<ComponentTask>();

	for (TaskSummary task : taskList) {
		ComponentTask componentTask = UIUtils.getComponentTask(task, topologyid);
		
		if (componentTask.getStatus().equals(ConfigExtension.TASK_STATUS_ACTIVE)) {
		    TaskStats taskStats = task.get_stats();

		    Map<String, Long> emitted = UIUtils.mergeStream(
				    taskStats.get_emitted(), Long.valueOf(0));
		    Map<String, Double> sendTps = UIUtils.mergeStream(
				    taskStats.get_send_tps(), Double.valueOf(0));
		    Map<String, Double> recvTps = UIUtils.mergeStream(
				    taskStats.get_recv_tps(), Double.valueOf(0));
		    Map<String, Long> acked = UIUtils.mergeStream(
				    taskStats.get_acked(), Long.valueOf(0));
		    Map<String, Long> failed = UIUtils.mergeStream(
				    taskStats.get_failed(), Long.valueOf(0));
		    Map<String, Double> process = UIUtils.mergeStream(
				    taskStats.get_process_ms_avg(), Double.valueOf(0));		

		    componentTask.setEmitted(JStormUtils.formatValue(emitted
				    .get(window)));
		    componentTask.setSendTps(JStormUtils.formatValue(sendTps
				    .get(window)));
		    componentTask.setRecvTps(JStormUtils.formatValue(recvTps
				    .get(window)));
		    componentTask.setAcked(JStormUtils.formatValue(acked.get(window)));
		    componentTask
				    .setFailed(JStormUtils.formatValue(failed.get(window)));
		    componentTask.setProcess(JStormUtils.formatValue(process
				    .get(window)));
		}

		ret.add(componentTask);
	}

	return ret;
}
 
開發者ID:zhangjunfang,項目名稱:jstorm-0.9.6.3-,代碼行數:42,代碼來源:BoltPage.java

示例4: mergeStream

import backtype.storm.generated.TaskStats; //導入依賴的package包/類
public static Map<StaticsType, List<Object>> mergeStream(
		List<TaskSummary> taskSummaries, String window) {

	Map<StaticsType, List<Object>> ret = new HashMap<StaticsType, List<Object>>();

	List<Object> emitted = new ArrayList<Object>();
	List<Object> sendTps = new ArrayList<Object>();
	List<Object> recvTps = new ArrayList<Object>();
	List<Object> acked = new ArrayList<Object>();
	List<Object> failed = new ArrayList<Object>();
	List<Object> process = new ArrayList<Object>();

	ret.put(StaticsType.emitted, emitted);
	ret.put(StaticsType.send_tps, sendTps);
	ret.put(StaticsType.recv_tps, recvTps);
	ret.put(StaticsType.acked, acked);
	ret.put(StaticsType.failed, failed);
	ret.put(StaticsType.process_latencies, process);

	for (TaskSummary taskSummary : taskSummaries) {
		TaskStats taskStats = taskSummary.get_stats();

		if (taskStats == null) {
			continue;
		}

		Map<String, Long> emittedMap = mergeStream(taskStats.get_emitted(),
				Long.valueOf(0));
		emitted.add(emittedMap.get(window));

		Map<String, Double> rendTpsMap = mergeStream(
				taskStats.get_send_tps(), Double.valueOf(0));
		sendTps.add(rendTpsMap.get(window));

		Map<String, Double> recvTpsMap = mergeStream(
				taskStats.get_recv_tps(), Double.valueOf(0));
		recvTps.add(recvTpsMap.get(window));

		Map<String, Long> ackedMap = mergeStream(taskStats.get_acked(),
				Long.valueOf(0));
		acked.add(ackedMap.get(window));

		Map<String, Long> failedMap = mergeStream(taskStats.get_failed(),
				Long.valueOf(0));
		failed.add(failedMap.get(window));

		Map<String, Double> processMap = mergeStream(
				taskStats.get_process_ms_avg(), Double.valueOf(0));
		process.add(processMap.get(window));
	}

	return ret;

}
 
開發者ID:zhangjunfang,項目名稱:jstorm-0.9.6.3-,代碼行數:55,代碼來源:UIUtils.java


注:本文中的backtype.storm.generated.TaskStats類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。