промежуточный. делаю задание числа потоков при тестировании через визуализатор
This commit is contained in:
@@ -24,8 +24,5 @@
|
|||||||
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
||||||
"InstructionPath": "",
|
"InstructionPath": "",
|
||||||
"PerformanceAnalyzerPath": "",
|
"PerformanceAnalyzerPath": "",
|
||||||
"ComponentsBackUpsCount": 10,
|
"ComponentsBackUpsCount": 10
|
||||||
"SapforTaskMaxId": 4212,
|
|
||||||
"threadsNum": 1,
|
|
||||||
"threadsTimeout": 2000
|
|
||||||
}
|
}
|
||||||
@@ -64,12 +64,6 @@ public class GlobalProperties extends Properties {
|
|||||||
public String PerformanceAnalyzerPath = "";
|
public String PerformanceAnalyzerPath = "";
|
||||||
@Expose
|
@Expose
|
||||||
public int ComponentsBackUpsCount=10;
|
public int ComponentsBackUpsCount=10;
|
||||||
@Expose
|
|
||||||
public long SapforTaskMaxId = 0; //вероятно, временно. когда перейдем на удаленную машину.
|
|
||||||
@Expose
|
|
||||||
public int threadsNum=1;//для пакетного режима.
|
|
||||||
@Expose
|
|
||||||
public int threadsTimeout = 2000; //для пакетного режима.
|
|
||||||
//-
|
//-
|
||||||
@Override
|
@Override
|
||||||
public String getFieldDescription(String fieldName) {
|
public String getFieldDescription(String fieldName) {
|
||||||
|
|||||||
@@ -124,12 +124,6 @@ public class GlobalDatabase extends SQLiteDatabase {
|
|||||||
Global.Log.PrintException(ex);
|
Global.Log.PrintException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public long IncSapforMaxTaskId() {
|
|
||||||
long res = Global.properties.SapforTaskMaxId;
|
|
||||||
Global.properties.SapforTaskMaxId++;
|
|
||||||
Global.properties.Update();
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
public DataSet<String, SapforTaskResult> getSapforPackagesMasterDataSet(SapforConfigurationTasksSet package_in) throws Exception {
|
public DataSet<String, SapforTaskResult> getSapforPackagesMasterDataSet(SapforConfigurationTasksSet package_in) throws Exception {
|
||||||
DataSet<String, SapforTaskResult> res = new DataSet<String, SapforTaskResult>(String.class, SapforTaskResult.class) {
|
DataSet<String, SapforTaskResult> res = new DataSet<String, SapforTaskResult>(String.class, SapforTaskResult.class) {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import com.google.gson.annotations.Expose;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class SapforTasksPackage_json {
|
public class SapforTasksPackage_json {
|
||||||
|
@Expose
|
||||||
|
public int kernels = 1;
|
||||||
@Expose
|
@Expose
|
||||||
public String sapfor_drv = ""; //файл с сапфором. Имя уникально для сценария.
|
public String sapfor_drv = ""; //файл с сапфором. Имя уникально для сценария.
|
||||||
@Expose
|
@Expose
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class SapforTasksPackage extends nDBObject {
|
|||||||
public long StartDate = 0; //дата начала выполнения
|
public long StartDate = 0; //дата начала выполнения
|
||||||
public long ChangeDate = 0;//дата окончания выполнения
|
public long ChangeDate = 0;//дата окончания выполнения
|
||||||
//-
|
//-
|
||||||
public int kernels=1; //количество потоков.д
|
public int kernels=1; //количество потоков.
|
||||||
@Description("DEFAULT 'Queued'")
|
@Description("DEFAULT 'Queued'")
|
||||||
public TasksPackageState state = TasksPackageState.Queued;
|
public TasksPackageState state = TasksPackageState.Queued;
|
||||||
// допустимые состояния
|
// допустимые состояния
|
||||||
@@ -37,6 +37,7 @@ public class SapforTasksPackage extends nDBObject {
|
|||||||
tasksCount = p.tasksCount;
|
tasksCount = p.tasksCount;
|
||||||
StartDate = p.StartDate;
|
StartDate = p.StartDate;
|
||||||
ChangeDate = p.ChangeDate;
|
ChangeDate = p.ChangeDate;
|
||||||
|
kernels = p.kernels;
|
||||||
state = p.state;
|
state = p.state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,11 +16,12 @@ public class SapforTasksPackageSupervisor extends ThreadsPlanner {
|
|||||||
SapforTasksPackage_json package_json = null;
|
SapforTasksPackage_json package_json = null;
|
||||||
SapforTasksResults_json results_json = new SapforTasksResults_json();
|
SapforTasksResults_json results_json = new SapforTasksResults_json();
|
||||||
public SapforTasksPackageSupervisor() throws Exception {
|
public SapforTasksPackageSupervisor() throws Exception {
|
||||||
super(Global.properties.threadsTimeout, Global.properties.threadsNum);
|
super(2000);
|
||||||
package_json = (SapforTasksPackage_json) Utils.jsonFromFile(new File(Global.Home, "package_json"), SapforTasksPackage_json.class);
|
package_json = (SapforTasksPackage_json) Utils.jsonFromFile(new File(Global.Home, "package_json"), SapforTasksPackage_json.class);
|
||||||
results_json.StartDate = new Date().getTime();
|
results_json.StartDate = new Date().getTime();
|
||||||
//формирование списка задач.
|
//формирование списка задач.
|
||||||
File sapfor_drv = new File(Global.Home, package_json.sapfor_drv);
|
File sapfor_drv = new File(Global.Home, package_json.sapfor_drv);
|
||||||
|
setMaxKernels(package_json.kernels);
|
||||||
for (SapforConfiguration_json sapforConfiguration_json : package_json.configurations) {
|
for (SapforConfiguration_json sapforConfiguration_json : package_json.configurations) {
|
||||||
for (String testName : package_json.tests) {
|
for (String testName : package_json.tests) {
|
||||||
//--- чтобы было можно на нее сослаться после выполнения всех нитей.
|
//--- чтобы было можно на нее сослаться после выполнения всех нитей.
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ public class SapforTasksPackage_info implements Serializable {
|
|||||||
@Expose
|
@Expose
|
||||||
public int sapforId = Constants.Nan; //файл с сапфором
|
public int sapforId = Constants.Nan; //файл с сапфором
|
||||||
@Expose
|
@Expose
|
||||||
|
public int kernels = 1;
|
||||||
|
@Expose
|
||||||
public List<String> testsIds = new Vector<>();
|
public List<String> testsIds = new Vector<>();
|
||||||
@Expose
|
@Expose
|
||||||
public List<String> configurationsIds = new Vector<>();
|
public List<String> configurationsIds = new Vector<>();
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ public abstract class ThreadsPlanner {
|
|||||||
protected Vector<Integer> activeThreads = new Vector<>();
|
protected Vector<Integer> activeThreads = new Vector<>();
|
||||||
protected Vector<Integer> waitingThreads = new Vector<>();
|
protected Vector<Integer> waitingThreads = new Vector<>();
|
||||||
//--
|
//--
|
||||||
public ThreadsPlanner(int wait_ms_in, int maxKernels_in) {
|
public ThreadsPlanner(int wait_ms_in) {
|
||||||
wait_ms = wait_ms_in;
|
wait_ms = wait_ms_in;
|
||||||
|
}
|
||||||
|
public void setMaxKernels(int maxKernels_in){
|
||||||
maxKernels = maxKernels_in;
|
maxKernels = maxKernels_in;
|
||||||
kernels = maxKernels;
|
kernels = maxKernels;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,6 +324,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
SetCurrentAccountDB(sapforTasksPackage_info.email);
|
SetCurrentAccountDB(sapforTasksPackage_info.email);
|
||||||
//--
|
//--
|
||||||
SapforTasksPackage_json package_json = new SapforTasksPackage_json();
|
SapforTasksPackage_json package_json = new SapforTasksPackage_json();
|
||||||
|
package_json.kernels = sapforTasksPackage_info.kernels;
|
||||||
for (String test_id : sapforTasksPackage_info.testsIds)
|
for (String test_id : sapforTasksPackage_info.testsIds)
|
||||||
package_json.tests.add(db.tests.get(test_id).description);
|
package_json.tests.add(db.tests.get(test_id).description);
|
||||||
//создание объекта набора задач. для бд.
|
//создание объекта набора задач. для бд.
|
||||||
@@ -369,8 +370,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
//создание настроек
|
//создание настроек
|
||||||
GlobalProperties properties = new GlobalProperties();
|
GlobalProperties properties = new GlobalProperties();
|
||||||
properties.Mode = Current.Mode.Package;
|
properties.Mode = Current.Mode.Package;
|
||||||
properties.threadsNum = Global.properties.threadsNum; //брать из настроек сервера же.
|
|
||||||
properties.threadsTimeout = Global.properties.threadsTimeout;
|
|
||||||
Utils.jsonToFile(properties, new File(sapforTasksPackage.workspace, "properties"));
|
Utils.jsonToFile(properties, new File(sapforTasksPackage.workspace, "properties"));
|
||||||
//создание инструкции
|
//создание инструкции
|
||||||
File package_json_file = new File(sapforTasksPackage.workspace, "package_json");
|
File package_json_file = new File(sapforTasksPackage.workspace, "package_json");
|
||||||
@@ -382,6 +381,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
sapforTasksPackage.sapfor_build_date = sapfor.buildDate;
|
sapforTasksPackage.sapfor_build_date = sapfor.buildDate;
|
||||||
sapforTasksPackage.testsNames = String.join(";", package_json.tests);
|
sapforTasksPackage.testsNames = String.join(";", package_json.tests);
|
||||||
sapforTasksPackage.StartDate = new Date().getTime();
|
sapforTasksPackage.StartDate = new Date().getTime();
|
||||||
|
sapforTasksPackage.kernels= sapforTasksPackage_info.kernels;
|
||||||
sapforTasksPackage.state = TasksPackageState.Queued;
|
sapforTasksPackage.state = TasksPackageState.Queued;
|
||||||
account_db.Update(sapforTasksPackage);
|
account_db.Update(sapforTasksPackage);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user