Search in sources :

Example 26 with SingularityAgent

use of com.hubspot.singularity.SingularityAgent in project Singularity by HubSpot.

the class SingularityUsageHelper method getAgentsToTrackUsageFor.

public List<SingularityAgent> getAgentsToTrackUsageFor() {
    List<SingularityAgent> agents = agentManager.getObjects();
    List<SingularityAgent> agentsToTrack = new ArrayList<>(agents.size());
    for (SingularityAgent agent : agents) {
        if (agent.getCurrentState().getState().isInactive() || agent.getCurrentState().getState() == MachineState.DECOMMISSIONED) {
            continue;
        }
        agentsToTrack.add(agent);
    }
    return agentsToTrack;
}
Also used : ArrayList(java.util.ArrayList) SingularityAgent(com.hubspot.singularity.SingularityAgent)

Aggregations

SingularityAgent (com.hubspot.singularity.SingularityAgent)26 Test (org.junit.jupiter.api.Test)13 SingularityMachineChangeRequest (com.hubspot.singularity.api.SingularityMachineChangeRequest)6 MesosMasterStateObject (com.hubspot.mesos.json.MesosMasterStateObject)4 MachineState (com.hubspot.singularity.MachineState)4 SingularityRack (com.hubspot.singularity.SingularityRack)4 ArrayList (java.util.ArrayList)4 SingularityTaskId (com.hubspot.singularity.SingularityTaskId)3 MesosMasterAgentObject (com.hubspot.mesos.json.MesosMasterAgentObject)2 SingularityMachineStateHistoryUpdate (com.hubspot.singularity.SingularityMachineStateHistoryUpdate)2 SingularityPendingTaskId (com.hubspot.singularity.SingularityPendingTaskId)2 SingularityTask (com.hubspot.singularity.SingularityTask)2 HashSet (java.util.HashSet)2 Optional (java.util.Optional)2 Timed (com.codahale.metrics.annotation.Timed)1 HashMultiset (com.google.common.collect.HashMultiset)1 Multiset (com.google.common.collect.Multiset)1 Inject (com.google.inject.Inject)1 Singleton (com.google.inject.Singleton)1 AgentPlacement (com.hubspot.singularity.AgentPlacement)1