package eu.gity.jmeter.ddos.common;

/**
 * Identifies DDoS samplers using trafgen packet generator and provides interface to their common functions
 *
 * @author Gity a.s.
 */
public interface Trafgen {

    /**
     * Stops trafgen processes belonging to the sampler
     */
	void stopTrafgen();

    /**
     * Verifies if packet count will be enough for the test duration
     *
     * @param tgName   name of the DDoS Thread Group in which the DDoS sampler resides
     * @param duration duration of the test calculated by DDoS Thread Group scheduler
     */
	void checkPacketCount(String tgName, long duration);

    /**
     * Tells sampler if rate will be changed dynamically
     *
     * @param dynamic true if rate will be changed dynamically
     */
	void setDynamicRate(boolean dynamic);

    /**
     * Increases or decreases pps rate which should be used in a next call of sample()
     *
     * @param rate either positive or negative pps change
     */
	void changeRate(int rateChange);

}
