当前位置: 首页>>代码示例>>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;未经允许,请勿转载。