Apdex.java

31 lines | 601 B Blame History Raw Download
package br.ufrgs.inf.prosoft.tigris.sampling;

public class Apdex {

    private long satisfied;
    private long tolerated;
    private long n;

    public Apdex(long satisfied, long tolerated, long n) {
        this.satisfied = satisfied;
        this.tolerated = tolerated;
        this.n = n;
    }

    public long getSatisfied() {
        return satisfied;
    }

    public long getTolerated() {
        return tolerated;
    }

    public long getN() {
        return n;
    }

    public double getApdexMetric(){
        return 1 - ((getSatisfied() + 0.5 * getTolerated()) / getN());
    }
}