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());
    }
}
