本文整理匯總了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;
}