Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more health checks #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/main/java/mesosphere/marathon/client/model/v2/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class App {
private Integer tasksStaged;
private Integer tasksRunning;
private List<HealthCheck> healthChecks;
private Integer tasksHealthy;

public String getId() {
return id;
Expand Down Expand Up @@ -169,7 +170,15 @@ public void setHealthChecks(List<HealthCheck> healthChecks) {
this.healthChecks = healthChecks;
}

@Override
public Integer getTasksHealthy() {
return tasksHealthy;
}

public void setTasksHealthy(Integer tasksHealthy) {
this.tasksHealthy = tasksHealthy;
}

@Override
public String toString() {
return ModelUtils.toString(this);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package mesosphere.marathon.client.model.v2;

import mesosphere.marathon.client.utils.ModelUtils;

/**
* Created by Tongqing Qiu on 8/19/15.
*/
public class HealthCheckResult {
private boolean alive;
private int consecutiveFailures;
private String firstSuccess;
private String lastFailure;
private String lastSuccess;
private String taskId;

public boolean isAlive() {
return alive;
}

public void setAlive(boolean alive) {
this.alive = alive;
}

public int getConsecutiveFailures() {
return consecutiveFailures;
}

public void setConsecutiveFailures(int consecutiveFailures) {
this.consecutiveFailures = consecutiveFailures;
}

public String getFirstSuccess() {
return firstSuccess;
}

public void setFirstSuccess(String firstSuccess) {
this.firstSuccess = firstSuccess;
}

public String getLastFailure() {
return lastFailure;
}

public void setLastFailure(String lastFailure) {
this.lastFailure = lastFailure;
}

public String getLastSuccess() {
return lastSuccess;
}

public void setLastSuccess(String lastSuccess) {
this.lastSuccess = lastSuccess;
}

public String getTaskId() {
return taskId;
}

public void setTaskId(String taskId) {
this.taskId = taskId;
}

@Override
public String toString() {
return ModelUtils.toString(this);
}

}
12 changes: 11 additions & 1 deletion src/main/java/mesosphere/marathon/client/model/v2/Task.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mesosphere.marathon.client.model.v2;

import java.util.Collection;
import java.util.List;

import mesosphere.marathon.client.utils.ModelUtils;

Expand All @@ -11,6 +12,7 @@ public class Task {
private Collection<Integer> ports;
private String stagedAt;
private String startedAt;
private List<HealthCheckResult> healthCheckResults;

public String getHost() {
return host;
Expand Down Expand Up @@ -60,7 +62,15 @@ public void setStartedAt(String startedAt) {
this.startedAt = startedAt;
}

@Override
public List<HealthCheckResult> getHealthCheckResults() {
return healthCheckResults;
}

public void setHealthCheckResults(List<HealthCheckResult> healthCheckResult) {
this.healthCheckResults = healthCheckResult;
}

@Override
public String toString() {
return ModelUtils.toString(this);
}
Expand Down