本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}