第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何測量 Apache Storm 中線程之間經(jīng)過的時(shí)間?

如何測量 Apache Storm 中線程之間經(jīng)過的時(shí)間?

慕哥9229398 2022-09-01 16:48:17
我正在使用[codahale-metrics]獲取Storm的螺栓和噴嘴的指標(biāo),并發(fā)送到Graphite服務(wù)器。我如何有時(shí)間在螺栓和噴嘴之間發(fā)送消息?例如。此代碼僅用于每個(gè)執(zhí)行器上的指標(biāo):import com.codahale.metrics.Histogram;import com.codahale.metrics.Meter;import com.codahale.metrics.Timer;public class MqttSensorDetailSpout extends BaseRichSpout {    private Meter tupleMeter;    private Timer tupleTimer;    private Histogram tupleHistogram;    public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {        this.context = context;        this.collector = collector;        this.tupleMeter = context.registerMeter("meterSpout-" + this.topic);        this.tupleTimer = context.registerTimer("timerSpout-" + this.topic);        this.tupleHistogram = context.registerHistogram("histogramSpout-" + this.topic);    }    public void nextTuple() {        final Timer.Context timeContext = this.tupleTimer.time();        this.tupleMeter.mark();        try {        …        } finally {            timeContext.stop();        }    }}我想知道在執(zhí)行器之間發(fā)送消息所經(jīng)過的時(shí)間。我將如何實(shí)現(xiàn)它?謝謝,費(fèi)利佩
查看完整描述

1 回答

?
藍(lán)山帝景

TA貢獻(xiàn)1843條經(jīng)驗(yàn) 獲得超7個(gè)贊

Storm不會(huì)為消息添加時(shí)間戳,因?yàn)槲覀儫o法確定人們是否在其服務(wù)器上設(shè)置了NTP或類似的東西。如果想知道將元組從一個(gè)執(zhí)行器發(fā)送到另一個(gè)執(zhí)行器需要多長時(shí)間,則應(yīng)手動(dòng)向發(fā)送的元組添加時(shí)間戳。您可以像添加任何其他元組字段一樣添加它。然后,下游 bolt 可以讀取輸入元組的時(shí)間戳,并計(jì)算傳輸所需的時(shí)間。


查看完整回答
反對(duì) 回復(fù) 2022-09-01
  • 1 回答
  • 0 關(guān)注
  • 99 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)