Profile.java

31 lines | 760 B Blame History Raw Download
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufrgs.inf.prosoft.requestssimulator;

import br.ufrgs.inf.prosoft.requestssimulator.requests.RequestPlan;
import java.util.Collection;

/**
 *
 * @author romulo
 */
public class Profile {

    private final Collection<RequestPlan> roots;

    public Profile(Collection<RequestPlan> roots) {
        this.roots = roots;
    }

    public void run(long time) {
        long end = System.currentTimeMillis() + time;
        while (System.currentTimeMillis() < end) {
            Session session = new Session(this.roots);
            session.run();
        }
    }
}