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

com.satori.mods.suite.HttpPostModStats 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 HttpPostModStats implements IStatsProvider {
  
  public int recv = 0;
  public int reqFailed = 0;
  public int reqSucceeded = 0;
  
  public HttpPostModStats() {
  }
  
  public HttpPostModStats(HttpPostModStats other) {
    recv = other.recv;
    reqSucceeded = other.reqSucceeded;
    reqFailed = other.reqFailed;
  }
  
  // IStatsProvider implementation
  
  @Override
  public void collect(IStatsCollector collector) {
    collector.sum("recv", recv);
    collector.sum("req.ok", reqSucceeded);
    collector.sum("req.err", reqFailed);
  }
  
  @Override
  public void suppress() {
    reset();
  }
  
  // public methods
  
  public void reset() {
    recv = 0;
    reqSucceeded = 0;
    reqFailed = 0;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy