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

Fix bugs #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
37 changes: 27 additions & 10 deletions loader-server/src/main/java/perf/server/domain/Job.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
package perf.server.domain;

import com.open.perf.domain.Load;
import com.open.perf.jackson.ObjectMapperUtil;
import com.open.perf.util.FileHelper;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import perf.server.cache.AgentsCache;
import perf.server.client.LoaderAgentClient;
import perf.server.client.MonitoringClient;
Expand All @@ -19,9 +34,10 @@
import perf.server.exception.LibNotDeployedException;
import perf.server.util.DeploymentHelper;

import java.io.*;
import java.util.*;
import java.util.concurrent.ExecutionException;
import com.open.perf.domain.Load;
import com.open.perf.jackson.ObjectMapperUtil;
import com.open.perf.util.FileHelper;


public class Job {

Expand All @@ -41,10 +57,10 @@ public static enum JOB_STATUS {
private Set<String> monitoringAgents;

public static class AgentJobStatus {
private String agentIp;
private boolean inStress;
private JOB_STATUS job_status;
private Map<String, Object> healthStatus;
private String agentIp=null;
private boolean inStress=false;
private JOB_STATUS job_status=null;
private Map<String, Object> healthStatus=new HashMap<String, Object>();

public String getAgentIp() {
return agentIp;
Expand Down Expand Up @@ -281,6 +297,7 @@ public void killed() throws InterruptedException, ExecutionException, IOExceptio
public void failedToStart() throws IOException {
this.jobStatus = JOB_STATUS.FAILED_TO_START;
this.endTime = new Date();
//this.agentsJobStatus.put("", arg1)
this.persist();
}

Expand Down