Package com.alibaba.jstorm.utils

Examples of com.alibaba.jstorm.utils.EventSampler


    if (num_out_tasks <= 0) {
      return;
    }

    EventSampler emittedSampler = emittedSamplers.get(stream);
    if (emittedSampler == null) {
      emittedSampler = new EventSampler(rate);
      emittedSamplers.put(stream, emittedSampler);
    }

    Integer times = emittedSampler.timesCheck();
    if (times != null) {
      update_task_stat(StaticsType.emitted, stream, times * num_out_tasks);
    }

    EventSampler sendTpsSampler = sendTpsSamplers.get(stream);
    if (sendTpsSampler == null) {
      sendTpsSampler = new EventSampler(rate);
      sendTpsSamplers.put(stream, sendTpsSampler);
    }
    Integer send = sendTpsSampler.tpsCheck();

    if (send != null) {

      update_task_stat(StaticsType.send_tps, stream, send * num_out_tasks);

 
View Full Code Here


    if (componentSamplers == null) {
      componentSamplers = new HashMap<String, EventSampler>();
      recvTpsSamplers.put(component, componentSamplers);
    }

    EventSampler sampler = componentSamplers.get(stream);
    if (sampler == null) {
      sampler = new EventSampler(rate);
      componentSamplers.put(stream, sampler);
    }

    Integer recv = sampler.tpsCheck();

    if (recv != null) {
      GlobalStreamId key = new GlobalStreamId(component, stream);
      update_task_stat(StaticsType.recv_tps, key, recv);
    }
View Full Code Here

    if (componentSamplers == null) {
      componentSamplers = new HashMap<String, EventSampler>();
      boltAckedSamplers.put(component, componentSamplers);
    }

    EventSampler sampler = componentSamplers.get(stream);
    if (sampler == null) {
      sampler = new EventSampler(rate);
      componentSamplers.put(stream, sampler);
    }

    Pair<Integer, Double> pair = sampler.avgCheck(latency_ms * 1000);
    if (pair == null) {
      return;
    }
   
    long avgLatency = (long)((double)pair.getSecond());
View Full Code Here

    if (componentSamplers == null) {
      componentSamplers = new HashMap<String, EventSampler>();
      boltFailedSamplers.put(component, componentSamplers);
    }

    EventSampler sampler = componentSamplers.get(stream);
    if (sampler == null) {
      sampler = new EventSampler(rate);
      componentSamplers.put(stream, sampler);
    }

    Integer times = sampler.timesCheck();
    if (times == null) {
      return;
    }

    GlobalStreamId key = new GlobalStreamId(component, stream);
View Full Code Here

    if (st == 0) {
      return;
    }

    EventSampler sampler = spoutAckedSamplers.get(stream);
    if (sampler == null) {
      sampler = new EventSampler(rate);
      spoutAckedSamplers.put(stream, sampler);
    }

   

    long latency_ms = TimeUtils.time_delta_ms(st);
    Pair<Integer, Double> pair = sampler.avgCheck(latency_ms * 1000);
    if (pair == null) {
      return;
    }
   
    long avgLatency = (long)((double)pair.getSecond());
View Full Code Here

  public void spout_failed_tuple(String stream) {
    if (enable == false) {
      return;
    }

    EventSampler sampler = spoutFailedSamplers.get(stream);
    if (sampler == null) {
      sampler = new EventSampler(rate);
      spoutFailedSamplers.put(stream, sampler);
    }

    Integer times = sampler.timesCheck();
    if (times == null) {
      return;
    }

    GlobalStreamId key = new GlobalStreamId(Common.ACKER_COMPONENT_ID,
View Full Code Here

TOP

Related Classes of com.alibaba.jstorm.utils.EventSampler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.