Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
432 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
SingularityBase/src/main/java/com/hubspot/singularity/SingularityDisabledActionType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,5 @@ | |||
package com.hubspot.singularity; | package com.hubspot.singularity; | ||
|
|
||
public enum SingularityDisabledActionType { | public enum SingularityDisabledActionType { | ||
BOUNCE, DEPLOY, SCALE, REMOVE, DECOMMISSION | BOUNCE, DEPLOY, SCALE, REMOVE, DECOMMISSION, TASK_RECONCILIATION | ||
} | } |
99 changes: 99 additions & 0 deletions
99
SingularityBase/src/main/java/com/hubspot/singularity/SingularityDisasterStats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,99 @@ | |||
package com.hubspot.singularity; | |||
|
|||
import java.util.Collections; | |||
import java.util.List; | |||
|
|||
import com.fasterxml.jackson.annotation.JsonCreator; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import com.google.common.base.Objects; | |||
|
|||
public class SingularityDisasterStats { | |||
private final long timestamp; | |||
private final int numActiveTasks; | |||
private final int numPendingTasks; | |||
private final int numOverdueTasks; | |||
private final long avgTaskLagMillis; | |||
private final int numActiveSlaves; | |||
private final int numLostSlaves; | |||
|
|||
@JsonCreator | |||
public SingularityDisasterStats(@JsonProperty("timestamp") long timestamp, | |||
@JsonProperty("numActiveTasks") int numActiveTasks, | |||
@JsonProperty("numPendingTasks") int numPendingTasks, | |||
@JsonProperty("numOverdueTasks") int numOverdueTasks, | |||
@JsonProperty("avgTaskLagMillis") long avgTaskLagMillis, | |||
@JsonProperty("numActiveSlaves") int numActiveSlaves, | |||
@JsonProperty("numLostSlaves") int numLostSlaves) { | |||
this.timestamp = timestamp; | |||
this.numActiveTasks = numActiveTasks; | |||
this.numPendingTasks = numPendingTasks; | |||
this.numOverdueTasks = numOverdueTasks; | |||
this.avgTaskLagMillis = avgTaskLagMillis; | |||
this.numActiveSlaves = numActiveSlaves; | |||
this.numLostSlaves = numLostSlaves; | |||
} | |||
|
|||
public long getTimestamp() { | |||
return timestamp; | |||
} | |||
|
|||
public int getNumActiveTasks() { | |||
return numActiveTasks; | |||
} | |||
|
|||
public int getNumPendingTasks() { | |||
return numPendingTasks; | |||
} | |||
|
|||
public int getNumOverdueTasks() { | |||
return numOverdueTasks; | |||
} | |||
|
|||
public long getAvgTaskLagMillis() { | |||
return avgTaskLagMillis; | |||
} | |||
|
|||
public int getNumActiveSlaves() { | |||
return numActiveSlaves; | |||
} | |||
|
|||
public int getNumLostSlaves() { | |||
return numLostSlaves; | |||
} | |||
|
|||
@Override | |||
public boolean equals(Object o) { | |||
if (this == o) { | |||
return true; | |||
} | |||
if (o == null || getClass() != o.getClass()) { | |||
return false; | |||
} | |||
SingularityDisasterStats that = (SingularityDisasterStats) o; | |||
return timestamp == that.timestamp && | |||
numActiveTasks == that.numActiveTasks && | |||
numPendingTasks == that.numPendingTasks && | |||
numOverdueTasks == that.numOverdueTasks && | |||
avgTaskLagMillis == that.avgTaskLagMillis && | |||
numActiveSlaves == that.numActiveSlaves && | |||
numLostSlaves == that.numLostSlaves; | |||
} | |||
|
|||
@Override | |||
public int hashCode() { | |||
return Objects.hashCode(timestamp, numActiveTasks, numPendingTasks, numOverdueTasks, avgTaskLagMillis, numActiveSlaves, numLostSlaves); | |||
} | |||
|
|||
@Override | |||
public String toString() { | |||
return Objects.toStringHelper(this) | |||
.add("timestamp", timestamp) | |||
.add("numActiveTasks", numActiveTasks) | |||
.add("numPendingTasks", numPendingTasks) | |||
.add("numOverdueTasks", numOverdueTasks) | |||
.add("avgTaskLagMillis", avgTaskLagMillis) | |||
.add("numActiveSlaves", numActiveSlaves) | |||
.add("numLostSlaves", numLostSlaves) | |||
.toString(); | |||
} | |||
} |
5 changes: 5 additions & 0 deletions
5
SingularityBase/src/main/java/com/hubspot/singularity/SingularityDisasterType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
package com.hubspot.singularity; | |||
|
|||
public enum SingularityDisasterType { | |||
EXCESSIVE_TASK_LAG, LOST_SLAVES; | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.