All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.satori.mods.suite.HttpPollModStats Maven / Gradle / Ivy

There is a newer version: 0.1.7
Show newest version
package com.satori.mods.suite;

import com.satori.mods.core.stats.*;

public class HttpPollModStats implements IStatsProvider {
  
  public int pollInit = 0;
  public int sent = 0;
  public int pollIdle = 0;
  public int pollFail = 0;
  
  public HttpPollModStats() {
  }
  
  public HttpPollModStats(HttpPollModStats other) {
    sent = other.sent;
    pollInit = other.pollInit;
    pollIdle = other.pollIdle;
    pollFail = other.pollFail;
  }
  
  // IStatsProvider implementation
  
  @Override
  public void collect(IStatsCollector collector) {
    collector.sum("sent", sent);
    collector.sum("poll.init", pollInit);
    collector.sum("poll.idle", pollIdle);
    collector.sum("poll.fail", pollFail);
  }
  
  @Override
  public void suppress() {
    reset();
  }
  
  // public methods
  
  public void reset() {
    sent = 0;
    pollInit = 0;
    pollIdle = 0;
    pollFail = 0;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy