стата вариантов в json
This commit is contained in:
@@ -46,23 +46,6 @@ public class PredictorStatistics extends DBObject {
|
||||
public Date getPredictionDate() {
|
||||
return new Date(PredictionTime);
|
||||
}
|
||||
//распаковка инфы о варианте от сапфора.
|
||||
public void Unpack(String packed) {
|
||||
String[] splited = packed.split("\\|");
|
||||
ParallelCount = Integer.parseInt(splited[0]);
|
||||
RemoteCount = Integer.parseInt(splited[1]);
|
||||
RedistributeCount = Integer.parseInt(splited[2]);
|
||||
IntervalCount = Integer.parseInt(splited[3]);
|
||||
PS_RemoteCount = Integer.parseInt(splited[4]);
|
||||
PS_ShadowCount = Integer.parseInt(splited[5]);
|
||||
PS_ReductionCount = Integer.parseInt(splited[6]);
|
||||
PS_AcrossCount = Integer.parseInt(splited[7]);
|
||||
try {
|
||||
TotalScore = Integer.parseInt(splited[8]);
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
PredictionTime = new Date().getTime();
|
||||
}
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return key;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Variants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.Pair;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ProjectData.PredictorStatistic.PredictorStatistics;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
@@ -9,6 +10,7 @@ import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
import java.io.File;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class ParallelVariant extends DBObject {
|
||||
@@ -42,7 +44,8 @@ public class ParallelVariant extends DBObject {
|
||||
father.db.predictorStatistics.Data.get(UniqKey) : new PredictorStatistics(UniqKey);
|
||||
}
|
||||
public void UpdateStats(String packed, String last_version) throws Exception {
|
||||
stats.Unpack(packed);
|
||||
stats = Utils_.gson.fromJson(packed, PredictorStatistics.class);
|
||||
stats.PredictionTime = new Date().getTime();
|
||||
stats.last_version = last_version;
|
||||
if (stats.loaded) {
|
||||
father.db.Update(stats);
|
||||
|
||||
Reference in New Issue
Block a user