Search in sources :

Example 1 with RunningBuildCount

use of org.jboss.pnc.dto.response.RunningBuildCount in project pnc by project-ncl.

the class BuildProviderImpl method getRunningCount.

@Override
public RunningBuildCount getRunningCount() {
    List<BuildTask> x = buildCoordinator.getSubmittedBuildTasks();
    int waitingForDependencies = 0;
    int running = 0;
    int enqueued = 0;
    for (BuildTask task : x) {
        switch(task.getStatus()) {
            case ENQUEUED:
                enqueued++;
                continue;
            case BUILDING:
                running++;
                continue;
            case WAITING_FOR_DEPENDENCIES:
                waitingForDependencies++;
                continue;
        }
    }
    return new RunningBuildCount(running, enqueued, waitingForDependencies);
}
Also used : BuildTask(org.jboss.pnc.spi.coordinator.BuildTask) RunningBuildCount(org.jboss.pnc.dto.response.RunningBuildCount)

Aggregations

RunningBuildCount (org.jboss.pnc.dto.response.RunningBuildCount)1 BuildTask (org.jboss.pnc.spi.coordinator.BuildTask)1